Skip to content

[CRASH] Crash in proto_tcp #2291

@adigeo

Description

@adigeo

OpenSIPS version you are running

version: opensips 3.1.0 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, 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: 3319120fb
main.c compiled on  with gcc 8```

**Crash Core Dump**
<!--
*Please* DO NOT post the content of the corefile here, but rather provide *a link* to a place (dropbox, pastebin, gdrive) where you stored the output of the core dump.
If you don't have a core dump, please generate one according to the steps described here:
https://www.opensips.org/Documentation/TroubleShooting-Crash
-->

**Describe the traffic that generated the bug**
<!--
Please describe what kind of traffic made OpenSIPS crash
-->

Unknow traffic

**To Reproduce**
<!--
Steps to reproduce the behavior:
Example:
1. Start OpenSIPS
2. Start traffic
3. Check OpenSIPS crashed
-->

**Relevant System Logs**
<!--
Please provide, in ticks block (```example```), relevant information from the system logs
-->

sudo gdb opensips core.18532.opensips.1602799880 

[New LWP 18532]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/opensips -w /run/opensips -P opensips.pid -a F_MALLOC_DBG -m 512'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f400a752535 in __GI_abort () at abort.c:79
#2 0x000056033c94787e in build_res_buf_from_sip_res (msg=msg@entry=0x560342cb8600, returned_len=returned_len@entry=0x7fff2ed27664,
sock=, flags=flags@entry=0) at msg_translator.c:2419
#3 0x00007f3fe9688a1d in relay_reply (t=0x7f3fec518c00, p_msg=, branch=0, msg_status=200,
cancel_bitmap=0x7fff2ed27754) at t_reply.c:1282
#4 0x00007f3fe968af9d in reply_received (p_msg=0x560342cb8600) at t_reply.c:1647
#5 0x000056033c91dad8 in forward_reply (msg=msg@entry=0x560342cb8600) at forward.c:499
#6 0x000056033c9066c7 in receive_msg (
buf=0x56033cc72ac0 <tcp_current_req> "SIP/2.0 200 OK\r\nVia: SIP/2.0/TCP 81.23.228.180:5060;branch=z9hG4bK0bed.86362ac.0\r\nVia: SIP/2.0/UDP 10.0.1.115:33503;received=95.238.189.100;rport=61791;branch=z9hG4bKPj05a40413-4fc5-4a98-ba0e-9a3228df"...,
len=, len@entry=2205, rcv_info=rcv_info@entry=0x7fff2ed279c0, existing_context=existing_context@entry=0x0,
msg_flags=msg_flags@entry=0) at receive.c:266
#7 0x000056033ca7aba5 in tcp_handle_req (_max_msg_chunks=, con=0x7f3fee2e4100, req=0x56033cc72ac0 <tcp_current_req>)
at net/proto_tcp/tcp_common.h:411
#8 tcp_read_req (con=, bytes_read=0x7fff2ed27a80) at net/proto_tcp/proto_tcp.c:1197
#9 0x000056033ca5ac7a in handle_io (fm=, idx=idx@entry=16, event_type=event_type@entry=1) at net/net_tcp_proc.c:312
#10 0x000056033ca5cfb1 in io_wait_loop_epoll (h=, t=, repeat=)
at net/../io_wait_loop.h:305
#11 tcp_worker_proc_loop () at net/net_tcp_proc.c:422
#12 0x000056033ca6d2cb in tcp_start_processes (chd_rank=chd_rank@entry=0x56033cc4c5c8 <chd_rank>,
startup_done=startup_done@entry=0x0) at net/net_tcp.c:2088
#13 0x000056033c8eb813 in main_loop () at main.c:810
#14 main (argc=, argv=) at main.c:1491
(gdb)

**OS/environment information**
 - Operating System: Debian 10
 - OpenSIPS installation: GIT 3319120fb8feed88027576ca45031c99455cd40a
 - other relevant information:

**Additional context**
<!-- Add any other context about the problem here. -->

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions