shadowsocks / ShadowsocksX-NG

Next Generation of ShadowsocksX
GNU General Public License v3.0
32.46k stars 7.95k forks source link

my macOS 13.3.1 Apple M2 ,ShadowsocksX-NG v1.10.2(1) with kcptun,not work. remind me "stream closed in xxx"frequently. but my windows pc work correctly,what the problem? #1466

Closed greatsunman closed 1 year ago

greatsunman commented 1 year ago

Describe the bug my macOS 13.3.1 Apple M2 ,ShadowsocksX-NG v1.10.2(1) with kcptun,not work. remind me "stream closed in xxx"frequently but my windows pc work correctly

To Reproduce skip

Expected behavior mac work correctlly the same as windows

Diagnoisis file:


{ "CFBundleName" : "ShadowsocksX-NG", "CFBundleIconFile" : "AppIcon", "LSApplicationCategoryType" : "public.app-category.utilities", "DTSDKBuild" : "22C55", "BuildMachineOSBuild" : "21G419", "DTPlatformBuild" : "14C18", "DTXcode" : "1420", "CFBundleIconName" : "AppIcon", "CFBundleDevelopmentRegion" : "en", "NSMainNibFile" : "MainMenu", "CFBundleNumericVersion" : 16809984, "DTPlatformVersion" : "13.1", "CFBundleIdentifier" : "com.qiuyuzhou.ShadowsocksX-NG", "CFBundleURLTypes" : [ { "CFBundleTypeRole" : "Viewer", "CFBundleURLIconFile" : "menu_icon@2x", "CFBundleURLSchemes" : [ "ss" ], "CFBundleURLName" : "shadowsocks" } ], "DTPlatformName" : "macosx", "CFBundlePackageType" : "APPL", "NSHumanReadableCopyright" : "Copyright © 2016-2019 qiuyuzhou. All rights reserved. License GPLv3.", "CFBundleInfoDictionaryVersion" : "6.0", "CFBundleVersion" : "1", "CFBundleSupportedPlatforms" : [ "MacOSX" ], "DTXcodeBuild" : "14C18", "CFBundleSignature" : "????", "DTCompiler" : "com.apple.compilers.llvm.clang.1_0", "NSPrincipalClass" : "SWBApplication", "LSUIElement" : true, "CFBundleShortVersionString" : "v1.10.2", "DTSDKName" : "macosx13.1", "CFBundleExecutable" : "ShadowsocksX-NG", "LSMinimumSystemVersion" : "10.12" }

Preferences: ShadowsocksOn=1 ShadowsocksRunningMode=global LocalSocks5.ListenPort=1086 LocalSocks5.ListenAddress=127.0.0.1 PacServer.BindToLocalhost=0 PacServer.ListenPort=1089 LocalSocks5.Timeout=60 LocalSocks5.EnableUDPRelay=0 LocalSocks5.EnableVerboseMode=0 GFWListURL=https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt LocalHTTP.ListenAddress=127.0.0.1 LocalHTTP.ListenPort=1087 LocalHTTPOn=1 LocalHTTP.FollowGlobal=1 ProxyExceptions=127.0.0.1, localhost, 192.168.0.0/16, 10.0.0.0/8, FE80::/64, ::1, FD00::/8

Active server profile: ServerHost=*** ServerPort=29900 Method=aes-128-gcm Password=** Plugin=kcptun PluginOptions=key=**;crypt=aes-128;mode=fast;mtu=1350;sndwnd=512;rcvwnd=512;datashard=10;parityshard=3;dscp=0

$ ls -l ~/Library/Application Support/ShadowsocksX-NG/ total 32 -rw-r--r--@ 1 user staff 759 Apr 10 18:18 com.qiuyuzhou.shadowsocksX-NG.http.plist -rw-r--r--@ 1 user staff 1036 Apr 10 18:18 com.qiuyuzhou.shadowsocksX-NG.local.plist drwxr-xr-x@ 3 user staff 96 Apr 10 18:10 kcptun drwxr-xr-x@ 7 user staff 224 Apr 10 18:10 plugins drwxr-xr-x@ 3 user staff 96 Apr 10 18:10 privoxy -rw-r--r--@ 1 user staff 642 Apr 10 18:18 privoxy.config drwxr-xr-x@ 3 user staff 96 Apr 10 18:10 simple-obfs drwxr-xr-x@ 3 user staff 96 Apr 10 18:10 ss-local -rw-r--r--@ 1 user staff 346 Apr 10 18:18 ss-local-config.json drwxr-xr-x@ 3 user staff 96 Apr 10 18:10 v2ray-plugin

$ ls -l ~/Library/LaunchAgents/ total 32 -rw-r--r--@ 1 user staff 814 Mar 29 17:16 com.google.keystone.agent.plist -rw-r--r--@ 1 user staff 920 Mar 29 17:16 com.google.keystone.xpcservice.plist -rw-r--r--@ 1 user staff 759 Mar 31 14:09 com.qiuyuzhou.shadowsocksX-NG.http.plist -rw-r--r--@ 1 user staff 1036 Apr 10 15:17 com.qiuyuzhou.shadowsocksX-NG.local.plist

$ ls -l ~/.ShadowsocksX-NG/ total 752 -rw-r--r--@ 1 user staff 173678 Apr 10 15:00 gfwlist.js -rw-r--r--@ 1 user staff 199993 Mar 31 10:27 gfwlist.txt -rw-r--r--@ 1 user staff 100 Mar 10 17:42 user-privoxy.config -rw-r--r--@ 1 user staff 95 Mar 10 17:42 user-rule.txt

$ ls -l /Library/Application Support/ShadowsocksX-NG/ total 440 -rwsr-sr-x@ 1 root admin 221792 Mar 29 01:43 proxy_conf_helper

$ lsof -PiTCP -sTCP:LISTEN COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME rapportd 1039 user 3u IPv4 0x83260f12b65e7f99 0t0 TCP :49158 (LISTEN) rapportd 1039 user 4u IPv6 0x83260f12b707cf91 0t0 TCP :49158 (LISTEN) ControlCe 1193 user 5u IPv4 0x83260f12b65ea0c9 0t0 TCP :7000 (LISTEN) ControlCe 1193 user 6u IPv6 0x83260f12b707bf91 0t0 TCP :7000 (LISTEN) ControlCe 1193 user 7u IPv4 0x83260f12b65eabd9 0t0 TCP :5000 (LISTEN) ControlCe 1193 user 8u IPv6 0x83260f12b707c791 0t0 TCP :5000 (LISTEN) privoxy 3305 user 3u IPv4 0x83260f12b5d7ebd9 0t0 TCP localhost:1087 (LISTEN) ss-local 3389 user 7u IPv4 0x83260f12b65c3489 0t0 TCP localhost:1086 (LISTEN) client 3392 user 9u IPv4 0x83260f12b65c4aa9 0t0 TCP localhost:52306 (LISTEN)

$ ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201<PERFORMNUD,DAD> gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 anpi0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=400 ether f2:9f:b5:de:51:3c inet6 fe80::f09f:b5ff:fede:513c%anpi0 prefixlen 64 scopeid 0x4 nd6 options=201<PERFORMNUD,DAD> media: none status: inactive anpi1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=400 ether f2:9f:b5:de:51:3d inet6 fe80::f09f:b5ff:fede:513d%anpi1 prefixlen 64 scopeid 0x5 nd6 options=201<PERFORMNUD,DAD> media: none status: inactive en3: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=400 ether f2:9f:b5:de:51:1c nd6 options=201<PERFORMNUD,DAD> media: none status: inactive en4: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=400 ether f2:9f:b5:de:51:1d nd6 options=201<PERFORMNUD,DAD> media: none status: inactive en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 options=460<TSO4,TSO6,CHANNEL_IO> ether 36:71:c6:d4:87:40 media: autoselect status: inactive en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 options=460<TSO4,TSO6,CHANNEL_IO> ether 36:71:c6:d4:87:44 media: autoselect status: inactive bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=63<RXCSUM,TXCSUM,TSO4,TSO6> ether 36:71:c6:d4:87:40 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x0 member: en1 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 8 priority 0 path cost 0 member: en2 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 9 priority 0 path cost 0 nd6 options=201<PERFORMNUD,DAD> media: status: inactive ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 options=400 ether a6:cf:99:6b:c9:be media: autoselect en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM> ether a4:cf:99:6b:c9:be inet 192.168.43.132 netmask 0xffffff00 broadcast 192.168.43.255 inet6 fe80::1434:43e7:1f72:3f6c%en0 prefixlen 64 secured scopeid 0xc inet6 2409:891f:f20:22c:473:7b2:7e95:5053 prefixlen 64 autoconf secured inet6 2409:891f:f20:22c:8c6a:ea9a:8167:5270 prefixlen 64 autoconf temporary nd6 options=201<PERFORMNUD,DAD> media: autoselect status: active awdl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM> ether 8e:04:ea:9c:41:95 inet6 fe80::8c04:eaff:fe9c:4195%awdl0 prefixlen 64 scopeid 0xd nd6 options=201<PERFORMNUD,DAD> media: autoselect status: active llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=400 ether 8e:04:ea:9c:41:95 inet6 fe80::8c04:eaff:fe9c:4195%llw0 prefixlen 64 scopeid 0xe nd6 options=201<PERFORMNUD,DAD> media: autoselect status: inactive utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380 inet6 fe80::4826:dacf:7e8e:be62%utun0 prefixlen 64 scopeid 0xf nd6 options=201<PERFORMNUD,DAD> utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::3e58:e36d:bba0:e397%utun1 prefixlen 64 scopeid 0x10 nd6 options=201<PERFORMNUD,DAD> utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000 inet6 fe80::ce81:b1c:bd2c:69e%utun2 prefixlen 64 scopeid 0x11 nd6 options=201<PERFORMNUD,DAD>

$ launchctl list | grep com.qiuyuzhou. 3305 0 com.qiuyuzhou.shadowsocksX-NG.http 3269 0 application.com.qiuyuzhou.ShadowsocksX-NG.2194219.2194464 3389 0 com.qiuyuzhou.shadowsocksX-NG.local

Screenshots skip

ss-local.log 2023-04-10 18:18:31 INFO: plugin "plugins/kcptun" enabled 2023-04-10 18:18:31 INFO: initializing ciphers... aes-128-gcm 2023-04-10 18:18:31 INFO: listening at 127.0.0.1:1086 2023-04-10 18:18:31 INFO: tcp port reuse enabled 2023/04/10 18:18:32 main.go:304: version: SELFBUILD 2023/04/10 18:18:32 main.go:310: smux version: 1 2023/04/10 18:18:32 main.go:311: listening on: 127.0.0.1:52306 2023/04/10 18:18:32 main.go:312: encryption: aes-128 2023/04/10 18:18:32 main.go:313: nodelay parameters: 0 30 2 1 2023/04/10 18:18:32 main.go:314: remote address: 172.105.158.103:29900 2023/04/10 18:18:32 main.go:315: sndwnd: 512 rcvwnd: 512 2023/04/10 18:18:32 main.go:316: compression: true 2023/04/10 18:18:32 main.go:317: mtu: 1350 2023/04/10 18:18:32 main.go:318: datashard: 10 parityshard: 3 2023/04/10 18:18:32 main.go:319: acknodelay: false 2023/04/10 18:18:32 main.go:320: dscp: 0 2023/04/10 18:18:32 main.go:321: sockbuf: 4194304 2023/04/10 18:18:32 main.go:322: smuxbuf: 4194304 2023/04/10 18:18:32 main.go:323: streambuf: 2097152 2023/04/10 18:18:32 main.go:324: keepalive: 10 2023/04/10 18:18:32 main.go:325: conn: 1 2023/04/10 18:18:32 main.go:326: autoexpire: 0 2023/04/10 18:18:32 main.go:327: scavengettl: 600 2023/04/10 18:18:32 main.go:328: snmplog: 2023/04/10 18:18:32 main.go:329: snmpperiod: 60 2023/04/10 18:18:32 main.go:330: quiet: false 2023/04/10 18:18:32 main.go:331: tcp: false 2023/04/10 18:18:32 main.go:338: initiating key derivation 2023/04/10 18:18:32 main.go:340: key derivation done 2023/04/10 18:21:28 main.go:395: smux version: 1 on connection: 0.0.0.0:64143 -> 172.105.158.103:29900 2023/04/10 18:21:28 main.go:38: stream opened in: 127.0.0.1:52316 out: 172.105.158.103:29900(3) 2023/04/10 18:21:29 main.go:38: stream closed in: 127.0.0.1:52316 out: 172.105.158.103:29900(3) 2023/04/10 18:21:29 main.go:38: stream opened in: 127.0.0.1:52318 out: 172.105.158.103:29900(5) 2023/04/10 18:21:29 main.go:38: stream closed in: 127.0.0.1:52318 out: 172.105.158.103:29900(5) 2023/04/10 18:21:30 main.go:38: stream opened in: 127.0.0.1:52320 out: 172.105.158.103:29900(7)

Application log 18:39:15.289074+0800 ShadowsocksX-NG server port 0x00003a07, session port 0x00003a07 18:39:15.297923+0800 ShadowsocksX-NG Received configuration update from daemon (initial) 18:39:15.298588+0800 ShadowsocksX-NG New connection 0x60b97 main 18:39:15.300513+0800 ShadowsocksX-NG CHECKIN: pid=3711 18:39:15.303659+0800 ShadowsocksX-NG CHECKEDIN: pid=3711 asn=0x0-0x95095 foreground=0 18:39:15.305675+0800 ShadowsocksX-NG FRONTLOGGING: version 1 18:39:15.305720+0800 ShadowsocksX-NG Registered, pid=3711 ASN=0x0,0x95095 18:39:15.307262+0800 ShadowsocksX-NG BringForward: pid=3711 asn=0x0-0x95095 bringForward=0 foreground=0 uiElement=1 launchedByLS=1 modifiersCount=1 allDisabled=0 18:39:15.307296+0800 ShadowsocksX-NG BringFrontModifier: pid=3711 asn=0x0-0x95095 Modifier 0 hideAfter=0 hideOthers=0 dontMakeFrontmost=0 mouseDown=0/0 seed=0/0 18:39:15.308083+0800 ShadowsocksX-NG Current system appearance, (HLTB: 1), (SLS: 0) 18:39:15.309806+0800 ShadowsocksX-NG No persisted cache on this platform. 18:39:15.311120+0800 ShadowsocksX-NG Current system appearance, (HLTB: 1), (SLS: 0) 18:39:15.311939+0800 ShadowsocksX-NG Post-registration system appearance: (HLTB: 1) 18:39:15.337438+0800 ShadowsocksX-NG Registering for test daemon availability notify post. 18:39:15.337538+0800 ShadowsocksX-NG notify_get_state check indicated test daemon not ready. 18:39:15.337630+0800 ShadowsocksX-NG notify_get_state check indicated test daemon not ready. 18:39:15.337707+0800 ShadowsocksX-NG notify_get_state check indicated test daemon not ready. 18:39:15.338126+0800 ShadowsocksX-NG Received DFR status change 0. status = 0x1 18:39:15.338692+0800 ShadowsocksX-NG Received DFR status change 1. status = 0x1 18:39:15.340359+0800 ShadowsocksX-NG SignalReady: pid=3711 asn=0x0-0x95095 18:39:15.340590+0800 ShadowsocksX-NG SIGNAL: pid=3711 asn=0x0x-0x95095 18:39:15.342348+0800 ShadowsocksX-NG Reacting to DFR status change 0. status = 0x1 18:39:15.342617+0800 ShadowsocksX-NG Reacting to DFR status change 1. status = 0x1 18:39:15.365550+0800 ShadowsocksX-NG NotifyToken::RegisterDispatch(user.uid.501.com.apple.LaunchServices.database) fired for session key 18:39:15.370140+0800 ShadowsocksX-NG Could not enable login item: com.qiuyuzhou.ShadowsocksX-NG.LaunchHelper: 1: Operation not permitted 18:39:15.370153+0800 ShadowsocksX-NG Call SMLoginItemSetEnabled with [0] failed 18:39:15.436224+0800 ShadowsocksX-NG Install ss-local succeeded. 18:39:15.500032+0800 ShadowsocksX-NG Install privoxy succeeded. 18:39:15.563934+0800 ShadowsocksX-NG Install simple-obfs succeeded. 18:39:15.627790+0800 ShadowsocksX-NG Install kcptun succeeded. 18:39:15.692075+0800 ShadowsocksX-NG Install v2ray-plugin succeeded. 18:39:15.701021+0800 ShadowsocksX-NG NSApp cache appearance: -NSRequiresAquaSystemAppearance: 0 -appearance: (null) -effectiveAppearance: <NSCompositeAppearance: 0x600001a5ba80 ( "<NSAquaAppearance: 0x600001a5ba00>", "<NSSystemAppearance: 0x600001a5ab80>" )> 18:39:15.706264+0800 ShadowsocksX-NG order window: 25a op: 1 relative: 25a related: 0 18:39:15.720822+0800 ShadowsocksX-NG generateSSLocalLauchAgentPlist - File has not been changed. 18:39:15.721285+0800 ShadowsocksX-NG writeSSLocalConfFile - File has been changed. 18:39:15.736532+0800 ShadowsocksX-NG Stop ss-local succeeded. 18:39:15.801762+0800 ShadowsocksX-NG Start privoxy succeeded. 18:39:15.802144+0800 ShadowsocksX-NG run shadowsocks helper: /Library/Application Support/ShadowsocksX-NG/proxy_conf_helper 18:39:15.838696+0800 ShadowsocksX-NG pac proxy set to global 18:39:15.841830+0800 ShadowsocksX-NG 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release 18:39:15.844721+0800 ShadowsocksX-NG 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release 18:39:16.848107+0800 ShadowsocksX-NG Start ss-local succeeded. 18:39:26.073585+0800 ShadowsocksX-NG NotifyToken::RegisterDispatch(user.uid.501.com.apple.LaunchServices.database) fired for session key 18:39:26.308583+0800 ShadowsocksX-NG LSExceptions shared instance invalidated for timeout.

Crash Log skip

Additional context skip