kcp
kcp copied to clipboard
segment->xmit Cannot access memory at address
Sometime ikcp_flush() raise segmentation fault. Below is back trace.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000562b87393905 in ikcp_flush (kcp=0x7f2fbc4f5d30) at ikcp.c:1052
1052 if (segment->xmit == 0) {
[Current thread is 1 (Thread 0x7f2fc53b6700 (LWP 98941))]
(gdb) bt
#0 0x0000562b87393905 in ikcp_flush (kcp=0x7f2fbc4f5d30) at ikcp.c:1052
#1 0x0000562b87393e24 in ikcp_update (kcp=0x7f2fbc4f5d30, current=3585797370) at ikcp.c:1169
#2 0x0000562b8738bca7 in media_transport_kcp_update (tp=0x7f2fbc000c08) at transport_ice.c:1740
#3 0x0000562b8738333a in micro_worker_proc (arg=0x7f2fb8000c08) at microhttpd.c:2274
#4 0x0000562b873b8b10 in thread_main ()
#5 0x00007f2fc82b5ea7 in start_thread (arg=
It seems that KCP object is not thread-safe, thus I have add a mutex lock to protect it.