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.26k stars 576 forks source link

[CRASH] Crash on REFER with b2b and rtp_relay, no SDP #3220

Open devoxy1 opened 11 months ago

devoxy1 commented 11 months ago

Hello!

I have opensips server with 2 TCP interfaces and b2b module setup. I have side A calling to opensips, opensips creates new leg with new callid from second interface to B, then A sends REFER with Refer-To: to C. I have also enabled flag no late sdp in b2b_bridge so i have SDP in the INVITE not ACK for new leg.

Peace of my config with REFER handle:

if ($rm != "REFER") {
    # for requests other than REFER, no special actions needs to be done,
    # just pass the request to the peer
    xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REQUEST] Passing request - From-tag: $ft, To-tag: $tt");
    b2b_pass_request();
    exit;
}

b2b_send_reply(202, "Accepted");

$socket_out=$socket_in;
force_send_socket("$socket_out");

b2b_client_new("referee", $var(refer-to),,,, $avp(b2b_hdrs), $avp(b2b_hdr_bodies));

# bridge the referrer's peer with the referee
b2b_bridge("peer", "referee",,"rollback-failed,notify,no-late-sdp");

OpenSIPS version you are running

version: opensips 3.5.0-dev (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, CC_O0, 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: caa78d967
main.c compiled on 18:26:18 Oct  4 2023 with gcc 9

Crash Core Dump I uploaded bt full and opensips log https://file.io/l8DaH9LFgr8t

Describe the traffic that generated the bug INVITE from REFER is generated without SDP which causes an error and crash

To Reproduce Steps to reproduce the behavior: Example:

  1. Start OpenSIPS
  2. Call from A to B via opensips
  3. opensips create new leg to B
  4. When call answered A sends REFER
  5. opensips create INVITE without SDP
  6. opensips crashes with error

Relevant System Logs

opensips[464036]: ERROR:rtp_relay:rtp_relay_b2b_tm_req: unknown session
opensips[464036]: INFO:b2b_logic:b2bl_add_client: adding entity [0x7fe63f17ca98]->[tsbc.14104.5099011.1696512267.717841290] to tuple [0x7fe63f15e1f8]->[12405.0]
opensips[464036]: ERROR:b2b_logic:bridging_start_new_ent: SDP not found
opensips[464036]: ERROR:b2b_logic:b2bl_bridge: Failed to start bridging with new entity
opensips[464036]: ERROR:b2b_logic:b2b_script_bridge: Failed to process bridge action

OS/environment information

Additional context There reverse algorythm, when B sends REFER to opensips, works absolutely fine.

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

devoxy1 commented 10 months ago

Up

devoxy1 commented 10 months ago

Hello,

Updating to version: version: opensips 3.4.2 (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: 6cfb172f0

fixed segfault and opensips doesn't crush anymore. However the problem with empty SDP with flag no-late-sdp (which should generate SDP on INVITE still in place. Now opensips doesn't crash but doesn't generate new INVITE and the call just hangs there with specified error ERROR:b2b_logic:bridging_start_new_ent: SDP not found

devoxy1 commented 10 months ago

I also caught segfault on this scenario with errors like this: WARNING:core:utimer_ticker: utimer task <tm-utimer> already scheduled 2890 ms ago (now 207480 ms), delaying execution attaching bt full here: https://file.io/RMmrWQyFHKKH

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

devoxy1 commented 9 months ago

The problem still persists (

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

devoxy1 commented 9 months ago

Up

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

devoxy1 commented 8 months ago

UP

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.

devoxy1 commented 7 months ago

up

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

devoxy1 commented 6 months ago

Up

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

devoxy1 commented 5 months ago

UP

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

devoxy1 commented 4 months ago

Up

devoxy1 commented 4 months ago

I haven't been testing it with new version yet. I will report once i do

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

devoxy1 commented 3 months ago

UP

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

devoxy1 commented 2 months ago

up

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

devoxy1 commented 2 months ago

Up

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

devoxy1 commented 3 weeks ago

up

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