OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.27k stars 578 forks source link

[CRASH] acc.c:701 - ctx->extra_values is 0x0 #3478

Open ar45 opened 3 weeks ago

ar45 commented 3 weeks ago

OpenSIPS version you are running

version: opensips 3.5.0 (x86_64/linux)
flags: STATS: On, EXTRA_DEBUG, 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: 284ab21ad
main.c compiled on 20:35:55 Sep 11 2024 with cc 12

Crash Core Dump

#0  0x00007aa85e8b9dbc in acc_db_cdrs (dlg=dlg@entry=0x7aa86017f4f0, msg=<optimized out>, ctx=ctx@entry=0x7aa85fed0e28) at acc.c:701
701         VAL_STR(db_vals+i) = ctx->extra_values[extra->tag_idx].value;
(gdb) bt full
#0  0x00007aa85e8b9dbc in acc_db_cdrs (dlg=dlg@entry=0x7aa86017f4f0, msg=<optimized out>, ctx=ctx@entry=0x7aa85fed0e28) at acc.c:701
        total = 41
        i = 7
        ret = 36
        res = -1
        j = <optimized out>
        nr_leg_vals = <optimized out>
        start_time = {tv_sec = 1727063477, tv_usec = 874037}
        core_s = {s = 0x7aa8a0bdda98 "\006", len = 91}
        leg_s = {s = 0x0, len = <optimized out>}
        extra_s = {s = 0x0, len = <optimized out>}
        table = {s = 0x7aa8601824e0 "acc", len = 3}
        my_ps = 0x0
        ins_list = 0x0
        extra = 0x7aa89fe16c68
        __FUNCTION__ = "acc_db_cdrs"
#1  0x00007aa85e8c8dfa in acc_dlg_ended (_params=0x7aa85ee42880 <params>, type=<optimized out>, dlg=0x7aa86017f4f0) at acc_logic.c:855
        t = <optimized out>
        ctx = 0x7aa85fed0e28
        t = <optimized out>
        ctx = <optimized out>
        __FUNCTION__ = "acc_dlg_ended"

To Reproduce Start 6 calls, and leave them hanging...

INVITE < 200 ACK

Kill the dialogs using mi command

opensips-cli -x mi dlg_list | jq '.Dialogs[].ID' -r | xargs -n 1 opensips-cli -x mi dlg_end_dlg

after 2 or 3 dialogs, opensips crashes

bogdan-iancu commented 3 weeks ago

Could you provide a full complete BT, please ?

ar45 commented 3 weeks ago

I'm having a hard time to reproduce this now. I wonder if this is a race condition killing the dialog in very early state.

github-actions[bot] commented 1 week ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

ar45 commented 1 week ago

@bogdan-iancu Could this be caused by another opensips instance running on the same machine accidentally sharing the same fifo file? does the shm memory get shared between the 2? or just with child processes ?