Launch by ss-server reports `panic: runtime error: index out of range`
kimw opened this issue · comments
Since v1.0.0 Add standalone mode when launch gq-server as a shadowsocks plugin, it reports panic: runtime error: index out of range. But not before v1.0.0.
-
Launched OK v0.1.0
$ ss-server -s 127.0.0.1 -p 8388 -k 123 -m rc4-md5 -v --plugin gq-server-linux64-0.1.0 --plugin-opts gqserver.json 2018-03-19 20:11:23 INFO: plugin "gq-server-linux64-0.1.0" enabled 2018-03-19 20:11:23 INFO: initializing ciphers... rc4-md5 2018-03-19 20:11:23 INFO: tcp server listening at 127.0.0.1:53311 2018/03/19 20:11:23 Listening on 127.0.0.1:8388
-
Panic v1.0.0, v1.0.1 & v1.0.2
$ ss-server -s 127.0.0.1 -p 8388 -k 123 -m rc4-md5 -v --plugin gq-server-linux64-1.0.0 --plugin-opts gqserver.json 2018-03-19 20:11:54 INFO: plugin "gq-server-linux64-1.0.0" enabled 2018-03-19 20:11:54 INFO: initializing ciphers... rc4-md5 2018-03-19 20:11:54 INFO: tcp server listening at 127.0.0.1:36343 panic: runtime error: index out of range goroutine 1 [running]: flag.init() /usr/lib/go-1.9/src/flag/flag.go:952 +0x137 main.init() <autogenerated>:1 +0x44 2018-03-19 20:11:54 ERROR: plugin service exit unexpectedly 2018-03-19 20:11:54 INFO: closed gracefully
The flag
package tries to get arguments from cli, but there's no argument at all when gq-server is launched by ss-server. So, index out of range is throw out.
Fixed in upstram project. See shadowsocks/shadowsocks-libev#1985
我昨天凌晨被這個問題卡了好久,心累……
多虧您改善了shadowsocks的代碼,我現在只需要更新源代碼重新編譯一遍就能解決問題了,感謝您的工作!
@IceCodeNew enjoy DIY ;-)