Skip to content

[CRASH] acc_logic / shm_free #3759

@medeanwz

Description

@medeanwz

OpenSIPS version you are running
3.4.14 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 277554f
main.c compiled on 11:53:09 Sep 19 2025 with gcc 11

Crash Core Dump

Program terminated with signal SIGSEGV, Segmentation fault.
#0 fm_frag_size (p=0x100000000) at mem/f_malloc.h:139
139 mem/f_malloc.h: No such file or directory.
(gdb) bt
#0 fm_frag_size (p=0x100000000) at mem/f_malloc.h:139
#1 0x00007fc0f3dc3f96 in _shm_free (line=171, function=0x7fc0f3dd45d8 <FUNCTION.18> "free_acc_ctx", file=0x7fc0f3dd433c "acc_logic.c", ptr=0x100000000) at ../tm/../../mem/shm_mem.h:548
#2 free_acc_ctx (ctx=) at acc_logic.c:171
#3 0x00007fc0f3dc46ae in acc_merge_contexts (dlg=, type=, _params=0x7fc0f3f34860 ) at acc_logic.c:559
#4 0x00007fc0f3e757ef in run_dlg_callbacks (type=type@entry=16, dlg=dlg@entry=0x7fc0f687dc00, msg=msg@entry=0x7fc2359c7150, dir=, dst_leg=, dlg_data=dlg_data@entry=0x0,
locked=locked@entry=0, is_active=is_active@entry=1) at dlg_cb.c:256
#5 0x00007fc0f3ea26e5 in dlg_onroute (req=req@entry=0x7fc2359c7150, route_params=route_params@entry=0x0, param=param@entry=0x7fc2359c7678) at dlg_handlers.c:2175
#6 0x00007fc0f3e67db5 in api_match_dialog (msg=0x7fc2359c7150, _seq_match_mode=) at dialog.c:1096
#7 0x00007fc0f3b9abeb in w_topology_hiding_match (req=0x7fc2359c7150, seq_match_mode_val=) at topology_hiding.c:255
#8 0x0000560fdae26b8f in do_action (a=a@entry=0x7fc234c34480, msg=msg@entry=0x7fc2359c7150) at action.c:1048
#9 0x0000560fdae29de3 in run_action_list (a=, msg=msg@entry=0x7fc2359c7150) at action.c:190
#10 0x0000560fdaf01dea in eval_elem (val=0x0, msg=0x7fc2359c7150, e=0x7fc234c345b0) at route.c:813
#11 eval_expr (e=0x7fc234c345b0, msg=msg@entry=0x7fc2359c7150, val=val@entry=0x0) at route.c:1137
#12 0x0000560fdae25a23 in do_action (a=a@entry=0x7fc234c36df8, msg=msg@entry=0x7fc2359c7150) at action.c:812
#13 0x0000560fdae29de3 in run_action_list (a=, msg=0x7fc2359c7150) at action.c:190
#14 0x0000560fdae27996 in do_action (a=a@entry=0x7fc234c66858, msg=msg@entry=0x7fc2359c7150) at action.c:836
#15 0x0000560fdae2a1ce in run_action_list (msg=, a=) at action.c:190
#16 run_actions (msg=0x7fc2359c7150, a=0x7fc234c66858) at action.c:136
#17 run_top_route (sr=..., msg=msg@entry=0x7fc2359c7150) at action.c:250
#18 0x0000560fdaee9e3a in receive_msg (buf=, len=, rcv_info=rcv_info@entry=0x7ffeb0759440, existing_context=existing_context@entry=0x0, msg_flags=msg_flags@entry=0) at receive.c:225
#19 0x0000560fdb0ea96a in udp_read_req (si=, bytes_read=) at net/proto_udp/proto_udp.c:186
#20 0x0000560fdb0d2ea8 in handle_io (idx=, event_type=, fm=) at net/net_udp.c:295
#21 io_wait_loop_epoll (repeat=, t=, h=) at net/../io_wait_loop.h:311
#22 0x0000560fdb0d7605 in fork_dynamic_udp_process (si_filter=0x7fc234c0a9c0) at net/net_udp.c:404
#23 0x0000560fdaebcb73 in do_workers_auto_scaling () at pt_scaling.c:348
#24 0x0000560fdae22424 in main_loop () at main.c:318
#25 main (argc=, argv=) at main.c:967

Describe the traffic that generated the bug
Normal traffic

To Reproduce
Happens randomly.

Relevant System Logs
Probably relevant:
ERROR:b2b_entities:_b2b_send_request: Can not send request [ACK] for entity type [1] for dlg[0x7fc10171a088]->[B2B.362.5056353.1763372066.1344836679] in terminated state
ERROR:media_exchange:media_session_req: Cannot send ACK to b2b entity key B2B.362.5056353.1763372066.1344836679
ERROR:media_exchange:media_session_get_hold_sdp: Dialog is NULL
ERROR:media_exchange:b2b_media_notify: could not establish media exchange!

OS/environment information
Debian 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions