Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ss-tunnel 在不支持TLS的平台上启动后出现Segmentation Fault #356

Closed
walkley opened this issue Jul 19, 2015 · 0 comments
Closed
Labels

Comments

@walkley
Copy link

walkley commented Jul 19, 2015

命令行参数如下:
ss-tunnel -c /opt/etc/shadowsocks.json -l 5353 -L 8.8.8.8:53 -u

用gdb调试,出现segmentation fault时的back trace如下:
#0 cork_buffer_vprintf (buffer=0x1, format=0x22d98 "Invalid IPv4 address: "%s"", args=...) at ds/buffer.c:195
#1 0x00018a18 in cork_error_set_printf (code=2514473928, format=0x22d98 "Invalid IPv4 address: "%s"") at core/er
#2 0x00017eb0 in cork_ipv4_parse (str=, addr=) at core/ip-address.c:101
#3 cork_ipv4_init (addr=, str=) at core/ip-address.c:108
#4 0x000186ec in cork_ip_init (addr=0xbee2aab8, str=0xbee2ae09 "8.8.8.8:53") at core/ip-address.c:473
#5 0x0000bfdc in parse_addr (str=0xbee2ae09 "8.8.8.8:53", addr=0xbee2abd4) at jconf.c:64
#6 0x0001387c in main (argc=8, argv=0xbee2ac94) at tunnel.c:767

简单分析了一下:

  1. jconf.c中的parse_addr函数会调用cork_ip_init,而cork_ip_init只能解析不带端口号的IP,如8.8.8.8。ss-tunnel的参数 -L 8.8.8.8:53会导致cork_ip_init出错。查看了一下jconf.c的历史,6bb29ab似乎是没必要的改动。
  2. cork_error_set_printf 调用cork_error_get时会出错,其原因是libcork默认会使用TLS,但在某些交叉编译平台上并没有启用TLS (如某些定制化的uClibc),从而会导致segmentation fault
@walkley walkley changed the title ss-tunnel 2.2.1在不支持TLS的平台上启动后出现Segmentation Fault ss-tunnel 在不支持TLS的平台上启动后出现Segmentation Fault Jul 19, 2015
@madeye madeye closed this as completed in 2b1eef1 Jul 19, 2015
@madeye madeye added the bug label Jul 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants