Project

General

Profile

Bug #2402

SCCP client segfaults when remote osmo-stp instance terminates

Added by neels 22 days ago. Updated 3 days ago.

Status:
Closed
Priority:
High
Assignee:
Start date:
07/27/2017
Due date:
% Done:

100%

Spec Reference:

Description

reproduction: run a (new) osmo-msc, -bsc or -hnbgw connecting to an osmo-stp, then ctrl-C the osmo-stp. Result:

Program received signal SIGSEGV, Segmentation fault.
llist_del (entry=<optimized out>) at ../../include/osmocom/core/linuxlist.h:126
126        __llist_del(entry->prev, entry->next);
(gdb) bt
#0  llist_del (entry=<optimized out>) at ../../include/osmocom/core/linuxlist.h:126
#1  _osmo_fsm_inst_term (fi=0x742a50, cause=OSMO_FSM_TERM_ERROR, data=0x0, file=0x7ffff5deb038 "../../src/xua_default_lm_fsm.c", line=370) at ../../src/fsm.c:475
#2  0x00007ffff5dddebd in osmo_ss7_asp_use_default_lm (asp=0x742820, log_level=1) at ../../src/xua_default_lm_fsm.c:370
#3  0x00007ffff75545ed in _osmo_fsm_inst_dispatch (fi=0x742a50, event=7, data=0x100100, data@entry=0x73fe38, file=0x7ffff5deb038 "../../src/xua_default_lm_fsm.c", line=370, line@entry=355) at ../../src/fsm.c:426
#4  0x00007ffff5dddd8d in default_lm_prim_cb (oph=0x73fe38, _asp=<optimized out>) at ../../src/xua_default_lm_fsm.c:355
#5  0x00007ffff5de3315 in xua_asp_send_xlm_prim (asp=0x742820, prim=0x73fe38) at ../../src/xua_asp_fsm.c:120
#6  0x00007ffff5dde9b3 in xua_cli_close_and_reconnect (cli=<optimized out>) at ../../src/osmo_ss7.c:1452
#7  xua_cli_read_cb (conn=0x742c00) at ../../src/osmo_ss7.c:1520
#8  0x00007ffff4bbc403 in osmo_stream_cli_read (cli=0x742c00) at ../../src/stream.c:166
#9  osmo_stream_cli_fd_cb (ofd=0x742c00, what=1) at ../../src/stream.c:250
#10 0x00007ffff75514a2 in osmo_fd_disp_fds (_eset=0x7fffffffe570, _wset=0x7fffffffe4f0, _rset=0x7fffffffe470) at ../../src/select.c:195
#11 osmo_select_main (polling=<optimized out>) at ../../src/select.c:235
#12 0x0000000000406cd4 in main (argc=1, argv=0x692370) at ../../../src/osmo-msc/msc_main.c:568
(gdb) 

History

#1 Updated by neels 22 days ago

log leading up to the segfault:

20170727150744730 DLINP <0023> ../../src/stream.c:249 connected read
20170727150744731 DLINP <0023> ../../src/stream.c:163 message received
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1503 asp-asp-clnt-OsmoMSC-Iu: xua_cli_read_cb(): sctp_recvmsg() returned 12 (flags=0x8080)
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1296 asp-asp-clnt-OsmoMSC-Iu: xUA CLNT SCTP NOTIFICATION 32773 flags=0x0
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1309 asp-asp-clnt-OsmoMSC-Iu: xUA CLNT SHUTDOWN_EVENT
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1445 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x742ea0]{ASP_ACTIVE}: Received Event SCTP-COMM_DOWN.ind
20170727150744731 DLSS7 <002d> ../../src/xua_asp_fsm.c:589 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x742ea0]{ASP_ACTIVE}: state_chg to ASP_DOWN
20170727150744731 DLSS7 <002d> ../../src/xua_asp_fsm.c:402 XUA_AS(as-clnt-OsmoMSC-Iu)[0x742490]{AS_ACTIVE}: Received Event ASPAS-ASP_DOWN.ind
20170727150744731 DLSS7 <002d> ../../src/xua_as_fsm.c:261 XUA_AS(as-clnt-OsmoMSC-Iu)[0x742490]{AS_ACTIVE}: state_chg to AS_PENDING
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:348 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Received primitive M-ASP_DOWN.indication
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:351 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Ignoring primitive M-ASP_DOWN.indication
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:348 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Received primitive M-SCTP_RELEASE.indication
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:355 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Received Event SCTP-RELEASE.ind
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1174 0: Restarting ASP asp-clnt-OsmoMSC-Iu
20170727150744731 DLGLOBAL <0021> ../../src/socket.c:258 unable to connect socket: 127.0.0.1:2905: Connection refused
20170727150744731 DLINP <0023> ../../src/stream.c:140 connection closed
20170727150744731 DLINP <0023> ../../src/stream.c:143 retrying in 5 seconds...
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1207 0: Unable to open stream client for ASP asp-clnt-OsmoMSC-Iu
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1228 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x742ea0]{ASP_DOWN}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
20170727150744731 DLSS7 <002d> ../../src/osmo_ss7.c:1228 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x742ea0]{ASP_DOWN}: Freeing instance
20170727150744731 DLSS7 <002d> ../../src/fsm.c:273 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x742ea0]{ASP_DOWN}: Deallocated
20170727150744731 DLSS7 <002d> ../../src/fsm.c:229 XUA_ASP(asp-clnt-OsmoMSC-Iu)[0x743050]{ASP_DOWN}: Allocated
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:129 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Terminating (cause = OSMO_FSM_TERM_ERROR)
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:129 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Freeing instance
20170727150744731 DLSS7 <002d> ../../src/fsm.c:273 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Deallocated
20170727150744731 DLSS7 <002d> ../../src/xua_default_lm_fsm.c:370 xua_default_lm(asp-clnt-OsmoMSC-Iu)[0x742a50]{ACTIVE}: Terminating (cause = OSMO_FSM_TERM_ERROR)

Program received signal SIGSEGV, Segmentation fault.
llist_del (entry=<optimized out>) at ../../include/osmocom/core/linuxlist.h:126
126        __llist_del(entry->prev, entry->next);
(gdb) bt
#0  llist_del (entry=<optimized out>) at ../../include/osmocom/core/linuxlist.h:126
#1  _osmo_fsm_inst_term (fi=0x742a50, cause=OSMO_FSM_TERM_ERROR, data=0x0, file=0x7ffff5deb038 "../../src/xua_default_lm_fsm.c", line=370) at ../../src/fsm.c:475
#2  0x00007ffff5dddebd in osmo_ss7_asp_use_default_lm (asp=0x742820, log_level=1) at ../../src/xua_default_lm_fsm.c:370
#3  0x00007ffff75545ed in _osmo_fsm_inst_dispatch (fi=0x742a50, event=7, data=0x100100, data@entry=0x73fe38, file=0x7ffff5deb038 "../../src/xua_default_lm_fsm.c", line=370, line@entry=355) at ../../src/fsm.c:426
#4  0x00007ffff5dddd8d in default_lm_prim_cb (oph=0x73fe38, _asp=<optimized out>) at ../../src/xua_default_lm_fsm.c:355
#5  0x00007ffff5de3315 in xua_asp_send_xlm_prim (asp=0x742820, prim=0x73fe38) at ../../src/xua_asp_fsm.c:120
#6  0x00007ffff5dde9b3 in xua_cli_close_and_reconnect (cli=<optimized out>) at ../../src/osmo_ss7.c:1452
#7  xua_cli_read_cb (conn=0x742c00) at ../../src/osmo_ss7.c:1520
#8  0x00007ffff4bbc403 in osmo_stream_cli_read (cli=0x742c00) at ../../src/stream.c:166
#9  osmo_stream_cli_fd_cb (ofd=0x742c00, what=1) at ../../src/stream.c:250
#10 0x00007ffff75514a2 in osmo_fd_disp_fds (_eset=0x7fffffffe570, _wset=0x7fffffffe4f0, _rset=0x7fffffffe470) at ../../src/select.c:195
#11 osmo_select_main (polling=<optimized out>) at ../../src/select.c:235
#12 0x0000000000406cd4 in main (argc=1, argv=0x692370) at ../../../src/osmo-msc/msc_main.c:568
(gdb) 

#2 Updated by laforge 3 days ago

  • Assignee set to laforge
  • Priority changed from Normal to High

#3 Updated by laforge 3 days ago

#4 Updated by laforge 3 days ago

  • Status changed from New to In Progress

#5 Updated by laforge 3 days ago

  • % Done changed from 0 to 90

Fixed by following commit which I just pushed to gerrit: https://gerrit.osmocom.org/3535

#6 Updated by laforge 3 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

merged to master.

Also available in: Atom PDF