hexian000 / kcptun-libev

A powerful and extremely lightweight encrypted port forwarder based on reliable UDP protocol.
MIT License
26 stars 7 forks source link

程序偶尔会崩溃 #3

Closed pexcn closed 1 year ago

pexcn commented 1 year ago

我把 kcptun-libev 封装成了一个 docker 镜像,今天无意中发现它的启动时间是十几个小时之前,而我部署完之后很久都没有动过这个容器,所以应该是程序崩溃导致容器自动重启了。麻烦作者排查一下😄

关键日志:

Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (ev_epoll.c: epoll_modify: 134)

具体的日志如下:

root@OpenWrt:~# docker logs kcptun-libev
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-19T01:22:20+0800 main.c:97 initializing...
D 2022-10-19T01:22:20+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:22:20+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:22:20+0800 packet.c:385 data will not be encrypted
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
I 2022-10-19T01:23:33+0800 main.c:97 initializing...
D 2022-10-19T01:23:33+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:23:33+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:23:33+0800 packet.c:385 data will not be encrypted
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:26+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:26+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:29+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:29+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:35+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:35+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-19T01:55:44+0800 main.c:97 initializing...
D 2022-10-19T01:55:44+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:55:44+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:55:44+0800 packet.c:385 data will not be encrypted
E 2022-10-19T23:51:10+0800 event_tcp.c:111 session [750C78B7] fd=35 tcp recv error: [104] Connection reset by peer
E 2022-10-21T13:44:51+0800 event_tcp.c:111 session [750CB771] fd=12 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:25:51+0800 event_tcp.c:111 session [750CC8B5] fd=39 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:25:52+0800 event_tcp.c:177 session [750CC8B8] fd=39 tcp send error: [104] Connection reset by peer
Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (ev_epoll.c: epoll_modify: 134)
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-21T21:25:52+0800 main.c:97 initializing...
D 2022-10-21T21:25:52+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-21T21:25:52+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-21T21:25:52+0800 packet.c:385 data will not be encrypted
E 2022-10-21T21:27:48+0800 event_tcp.c:111 session [2D3E37EB] fd=24 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:51+0800 event_tcp.c:111 session [2D3E3812] fd=37 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:53+0800 event_tcp.c:111 session [2D3E3815] fd=26 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:53+0800 event_tcp.c:177 session [2D3E3816] fd=26 tcp send error: [104] Connection reset by peer
Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (ev_epoll.c: epoll_modify: 134)
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-21T21:28:54+0800 main.c:97 initializing...
D 2022-10-21T21:28:54+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-21T21:28:54+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-21T21:28:54+0800 packet.c:385 data will not be encrypted
W 2022-10-23T00:21:42+0800 packet.c:263 session not found [20889C17]
W 2022-10-23T00:21:43+0800 packet.c:263 session not found [20889C17]
W 2022-10-23T00:21:54+0800 packet.c:263 session not found [20889C17]
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-25T11:09:01+0800 main.c:97 initializing...
D 2022-10-25T11:09:01+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-25T11:09:01+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-25T11:09:01+0800 packet.c:385 data will not be encrypted
W 2022-10-25T15:01:51+0800 packet.c:263 session not found [AEE854AF]
W 2022-10-25T15:03:50+0800 packet.c:263 session not found [AEE854C0]
W 2022-10-25T15:05:21+0800 packet.c:263 session not found [AEE854C6]
W 2022-10-25T15:09:43+0800 packet.c:263 session not found [AEE854E1]
root@OpenWrt:~#
root@OpenWrt:~# docker logs kcptun-libev
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-19T01:22:20+0800 main.c:97 initializing...
D 2022-10-19T01:22:20+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:22:20+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:22:20+0800 packet.c:385 data will not be encrypted
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:22:32+0800 event_udp.c:21 udp connection refused, closing all sessions
I 2022-10-19T01:23:33+0800 main.c:97 initializing...
D 2022-10-19T01:23:33+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:23:33+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:23:33+0800 packet.c:385 data will not be encrypted
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:22+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:24+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:25+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:26+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:26+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:29+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:29+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:30+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:31+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:33+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:35+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:28:35+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
W 2022-10-19T01:32:23+0800 event_udp.c:21 udp connection refused, closing all sessions
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-19T01:55:44+0800 main.c:97 initializing...
D 2022-10-19T01:55:44+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-19T01:55:44+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-19T01:55:44+0800 packet.c:385 data will not be encrypted
E 2022-10-19T23:51:10+0800 event_tcp.c:111 session [750C78B7] fd=35 tcp recv error: [104] Connection reset by peer
E 2022-10-21T13:44:51+0800 event_tcp.c:111 session [750CB771] fd=12 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:25:51+0800 event_tcp.c:111 session [750CC8B5] fd=39 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:25:52+0800 event_tcp.c:177 session [750CC8B8] fd=39 tcp send error: [104] Connection reset by peer
Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (ev_epoll.c: epoll_modify: 134)
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-21T21:25:52+0800 main.c:97 initializing...
D 2022-10-21T21:25:52+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-21T21:25:52+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-21T21:25:52+0800 packet.c:385 data will not be encrypted
E 2022-10-21T21:27:48+0800 event_tcp.c:111 session [2D3E37EB] fd=24 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:51+0800 event_tcp.c:111 session [2D3E3812] fd=37 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:53+0800 event_tcp.c:111 session [2D3E3815] fd=26 tcp recv error: [104] Connection reset by peer
E 2022-10-21T21:28:53+0800 event_tcp.c:177 session [2D3E3816] fd=26 tcp send error: [104] Connection reset by peer
Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (ev_epoll.c: epoll_modify: 134)
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-21T21:28:54+0800 main.c:97 initializing...
D 2022-10-21T21:28:54+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-21T21:28:54+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-21T21:28:54+0800 packet.c:385 data will not be encrypted
W 2022-10-23T00:21:42+0800 packet.c:263 session not found [20889C17]
W 2022-10-23T00:21:43+0800 packet.c:263 session not found [20889C17]
W 2022-10-23T00:21:54+0800 packet.c:263 session not found [20889C17]
kcptun-libev v2.0.1
  http://github.com/hexian000/kcptun-libev

I 2022-10-25T11:09:01+0800 main.c:97 initializing...
D 2022-10-25T11:09:01+0800 conf.c:299 resolve: "127.0.0.1:1983" is 127.0.0.1:1983
D 2022-10-25T11:09:01+0800 conf.c:299 resolve: "127.0.0.1:1982" is 127.0.0.1:1982
W 2022-10-25T11:09:01+0800 packet.c:385 data will not be encrypted
W 2022-10-25T15:01:51+0800 packet.c:263 session not found [AEE854AF]
W 2022-10-25T15:03:50+0800 packet.c:263 session not found [AEE854C0]
W 2022-10-25T15:05:21+0800 packet.c:263 session not found [AEE854C6]
W 2022-10-25T15:09:43+0800 packet.c:263 session not found [AEE854E1]
hexian000 commented 1 year ago

未加密情形下的协议安全暂无计划支持,请在安全的场景中使用未加密模式

pexcn commented 1 year ago

kcptun-libev 转发的是 shadowsocks 的端口,而 shadowsocks 的端口是已经加密的了,这样不是相当于已经加密了吗?😅

hexian000 commented 1 year ago

kcptun-libev 转发的是 shadowsocks 的端口,而 shadowsocks 的端口是已经加密的了,这样不是相当于已经加密了吗?😅

攻击面取决于直接暴露于公网的服务。截至v2.0.1,kcptun-libev直接暴露于公网时,不适合使用未加密模式。