xebd / accel-ppp

High performance PPTP/L2TP/PPPoE/IPoE server for Linux
GNU General Public License v2.0
296 stars 109 forks source link

pppd_compat: crash after ip-down #29

Closed themiron closed 6 years ago

themiron commented 6 years ago

Recent changes of context sleeping & pppd_compat have introduced crash. Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.93-1 x86_64 GNU/Linux Reproduciable every time if ip-down is set on user-initiated PPTP disconnect.

gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf62e4b70 (LWP 18423)]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xf7fd6f03 in ctx_thread (ctx=0x1860) at /home/themiron/accel-ppp/accel-pppd/triton/triton.c:218
#2  triton_thread (thread=0x80acbf4) at /home/themiron/accel-ppp/accel-pppd/triton/triton.c:185
#3  0xf7fa2c39 in start_thread (arg=0xf62e4b70) at pthread_create.c:304
#4  0xf7cae8be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

triton debug log

[2017-12-15 19:41:25.983] thread: 0x80acbf4: sleeping
[2017-12-15 19:41:27.129] ctx 0x80af604: assigned to thread 0x80acbf4
[2017-12-15 19:41:27.129] wake up thread 0x80acbf4
[2017-12-15 19:41:27.129] thread 0x80acbf4: ctx=0x80af604 0x80acbf4
[2017-12-15 19:41:27.129] thread 0x80acbf4: switch to 0x80af604
[2017-12-15 19:41:27.129] ctx 0x80af604 0x80acbf4: enter
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: recv [PPTP Set-Link-Info]
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: recv [LCP TermReq id=d]
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: send [LCP TermAck id=13]
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: terminate
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: lcp_layer_finish
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: auth_layer_finish
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: auth_layer_finished
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ccp_layer_finish
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ccp_layer_finished
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ipcp_layer_finish
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ipcp_layer_finished
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ipv6cp_layer_finish
[2017-12-15 19:41:27.129] pptp0: 33042fb065e7f5ed: ipv6cp_layer_finished
[2017-12-15 19:41:27.132] libnetlink: RTNETLINK answers: Cannot assign requested address
[2017-12-15 19:41:27.133] ctx 0x80af604 0x80acbf4: exit
[2017-12-15 19:41:27.133] thread 0x80acbf4: switch from 0x80af604 0x80acbf4
[2017-12-15 19:41:27.133] thread: 0x80acbf4: sleeping
[2017-12-15 19:41:27.203] ctx 0x80af604: assigned to thread 0x80acbf4
[2017-12-15 19:41:27.203] wake up thread 0x80acbf4
[2017-12-15 19:41:27.203] thread 0x80acbf4: ctx=0x80af604 0x80acbf4
[2017-12-15 19:41:27.203] thread 0x80acbf4: switch to 0x80af604
[2017-12-15 19:41:27.203] ctx 0x80af604 0x80acbf4: enter
[2017-12-15 19:41:27.203] pptp0: 33042fb065e7f5ed: recv [PPTP Call-Clear-Request <Call-ID 9499>]
[2017-12-15 19:41:27.237] pptp0: 33042fb065e7f5ed: pppd_compat: ip-down started (pid 18449)
[2017-12-15 19:41:27.237] ctx 0x80af604: enter schedule
[2017-12-15 19:41:27.237] thread: 0x80acbf4: sleeping
[2017-12-15 19:41:27.241] pptp0: 33042fb065e7f5ed: pppd_compat: ip-down finished (0)
[2017-12-15 19:41:27.241] ctx 0x80af604: wakeup
[2017-12-15 19:41:27.241] wake up thread 0x80acbf4
[2017-12-15 19:41:27.241] thread: 0x80acbf4: wakeup ctx 0x80af604