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.28k stars 581 forks source link

[CRASH] Opensips fault when use b2b #3336

Closed BTa7BxrHYn closed 7 months ago

BTa7BxrHYn commented 8 months ago

OpenSIPS version you are running

version: opensips 3.4.4 (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: 87e9c6598
main.c compiled on  with gcc 10

Crash Core Dump

Dump log

Describe the traffic that generated the bug

Load Test Traffic Generated by Sipp

To Reproduce

pbx -> opensips -> asterisk The call from pbx triggers a callback from asterisk and waits on wait_for_event. An outgoing call from asterisk creates a b2b session. After the call goes to answered status, I make a b2b_bridge_request and connect the call from pbx and the answered call from asterisk Relevant System Logs

OS/environment information

Additional context

By the way, the patch from case 3240 is not included in the main tree

BTa7BxrHYn commented 7 months ago

Similar behavior in version 3.4.3

github-actions[bot] commented 7 months 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.

BTa7BxrHYn commented 7 months ago

The problem is there is no option modparam("b2b_entities", "b2b_key_prefix", "B2B1") Because the scheme uses two b2b servers b2b -> b2b -> asterisk this causes 2 b2b instances to crash

#2 0x00007f3ad6b05cd1 in b2b_prescript_f (msg=0x7f3b179d4620, uparam=<optimized out>) at /home/src/opensips_3_4/modules/b2b_entities/dlg.c:1003 b2b_key = { s = 0x561de6fa23f6 <buf+214> "B2B.14840.6865846.1712305295.1231039807\r\nTo: <sip:84959600744@10.145.254.44:5060>;tag=e1ff-db0747c77c9299840359e1ece9d80c7f\r\nCSeq: 644 ACK\r\nMax-Forwards: 70\r\nUser-Agent: SCPD\r\nContent-Length: 0\r\n\r\n", len = 39} dlg = 0x0 aux_dlg = <optimized out> hash_index = 14840 local_index = 6865846 b2b_cback = <optimized out> logic_key = {s = 0x0, len = 0} table = 0x7f3ad6fcaf48 method_value = 4 from_tag = { s = 0x561de6fa23c6 <buf+166> "d974c1815058306a295c5fe1f1514bda-2639\r\nCall-ID: B2B.14840.6865846.1712305295.1231039807\r\nTo: <sip:84959600744@10.145.254.44:5060>;tag=e1ff-db0747c77c9299840359e1ece9d80c7f\r\nCSeq: 644 ACK\r\nMax-Forwards"..., len = 37} to_tag = {s = 0x561de6fa244c <buf+300> "e1ff-db0747c77c9299840359e1ece9d80c7f\r\nCSeq: 644 ACK\r\nMax-Forwards: 70\r\nUser-Agent: SCPD\r\nContent-Length: 0\r\n\r\n", len = 37} callid = { s = 0x561de6fa23f6 <buf+214> "B2B.14840.6865846.1712305295.1231039807\r\nTo: <sip:84959600744@10.145.254.44:5060>;tag=e1ff-db0747c77c9299840359e1ece9d80c7f\r\nCSeq: 644 ACK\r\nMax-Forwards: 70\r\nUser-Agent: SCPD\r\nContent-Length: 0\r\n\r\n", len = 39} tm_tran = <optimized out> ret = <optimized out> host = {s = 0x7c00000003 <error: Cannot access memory at address 0x7c00000003>, len = 5} port = <optimized out> etype = 2 dlg_state = 0 puri = {user = {s = 0x561de6e7e880 <log_consumers_no> "\003", len = -424167447}, passwd = {s = 0x7ffcbf745040 "pPt\277\374\177", len = -1082896316}, host = {s = 0x0, len = 6144}, port = { s = 0x561de6d95218 "%s [%d] %sDBG:core:%s: flags=%llx\n", len = 515836672}, params = {s = 0x0, len = 1}, headers = {s = 0x561de6e7f2f0 <log_consumers> "p\221\322\326:\177", len = 4}, port_no = 32288, proto = 59094, type = 22045, transport = {s = 0x7ffcbf745030 "0", len = -421009280}, ttl = {s = 0x561de6b762ca <dprint+330> "H\203\304 H\203\303\001A9\037\177\221H\213D$hdH+\004%(", len = -422150616}, user_param = {s = 0x561de6d6ae35 "MD5 calculated: %.*s\n", len = -1082896336}, maddr = {s = 0xa2d804991ebf0b00 <error: Cannot access memory at address 0xa2d804991ebf0b00>, len = -1082896248}, method = { s = 0xa0e6e812a0 <error: Cannot access memory at address 0xa0e6e812a0>, len = -422196924}, lr = {s = 0x561de6d6b5b0 <__FUNCTION__.1.lto_priv.15> "MD5StringArray", len = -422150616}, r2 = { s = 0x561de6d6ae35 "MD5 calculated: %.*s\n", len = 48}, gr = {s = 0x7ffcbf745198 "*ݸ\346\035V", len = -1082896272}, pn_provider = {s = 0x7ffcbf745140 "}D\017", len = 48}, pn_prid = { s = 0x7ffcbf745168 "\244\022\350\346\035V", len = -1082896272}, pn_param = {s = 0xa2d804991ebf0b00 <error: Cannot access memory at address 0xa2d804991ebf0b00>, len = -1082896116}, pn_purr = { s = 0x7f3b1ee3434e "Fri", len = 518210459}, transport_val = {s = 0x5 <error: Cannot access memory at address 0x5>, len = -420999552}, ttl_val = { s = 0x7f3b1ed38c59 <__tzfile_compute+1385> "H\213\005 K\024", len = 825110577}, user_param_val = {s = 0x7ffcbf745110 "", len = -1082896048}, maddr_val = { s = 0x6236322e65646138 <error: Cannot access memory at address 0x6236322e65646138>, len = 1681078582}, method_val = {s = 0x7ffcbf745150 "\200\016\350\346\035V", len = 1}, lr_val = { s = 0x7ffcbf745150 "\200\016\350\346\035V", len = 1712305299}, r2_val = {s = 0x7ffcbf7451a8 "\223\264\017f", len = -420999552}, gr_val = {s = 0x7f3b1ed37602 <__tz_convert+178> "\205\300\017\204\216", len = -1082895936}, pn_provider_val = {s = 0x8 <error: Cannot access memory at address 0x8>, len = 0}, pn_prid_val = { s = 0x7f3b1ed34c80 <__asctime_r+128> "H\203\304 \205\300xH\203\370\031\177#L\211\340A\\\303\017\037D", len = 11}, pn_param_val = {s = 0x561de6e812a0 <ctime_buf> "Fri Apr 5 11:22:47", len = -421831924}, pn_purr_val = {s = 0x7f3ad6c42185 <sl_tag_buf+5> "db0747c77c9299840359e1ece9d80c7f", len = 1000573}, u_name = {{s = 0x7ffcbf7451a8 "\223\264\017f", len = -420999552}, { s = 0x561de6b8dd78 <MD5StringArray+504> "H\203\304@\351!\377\377\377L\215t$ \351\274\376\377\377\350\060 \374\377A\211\305\351s\377\377\377\350\243 \374\377\017\037", len = -422138315}, { s = 0x561de6e812a4 <ctime_buf+4> "Apr 5 11:22:47", len = 1000573}, {s = 0x561de6db5b0c "", len = -422136400}, {s = 0x20 <error: Cannot access memory at address 0x20>, len = -691789435}, { s = 0x561de6b8dd2a <MD5StringArray+426> "H\203\354\bH\215\r{\330\035", len = -421969128}, {s = 0x660fb493 <error: Cannot access memory at address 0x660fb493>, len = -951646245}, { s = 0x7f0cd8e9ece15903 <error: Cannot access memory at address 0x7f0cd8e9ece15903>, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}}, u_val = {{s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0xa2d804991ebf0b00 <error: Cannot access memory at address 0xa2d804991ebf0b00>, len = 3}, {s = 0x7f3b179d4620 "\031", len = 396291656}, {s = 0x0, len = 382281424}, { s = 0x7f3ad6c3ce19 <sl_filter_ACK+265> "A\211ą\300\017\205\024\377\377\377H\213\005%Q", len = 0}, {s = 0x0, len = -419814559}, {s = 0xd <error: Cannot access memory at address 0xd>, len = -419814545}, {s = 0x4 <error: Cannot access memory at address 0x4>, len = -419814533}}, u_params_no = 22} route_hdr = <optimized out> rt = <optimized out> b2b_ev = -1 storage = {buffer = {s = 0x660fb493 <error: Cannot access memory at address 0x660fb493>, len = 0}, front_pointer = 0x0, size = 515836672, type = -1562901351, src_id = 0} ctx = <optimized out> --Type <RET> for more, q to quit, c to continue without paging-- b2b_cb_flags = 0 ua_flags = 0 ua_ev_type = -1 logic_notify = <optimized out> __FUNCTION__ = "b2b_prescript_f"

please add patch 3240 to the main tree