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 583 forks source link

[CRASH] 3.2.5 => 3.2.6 (UAC Registrant) => CRITICAL:core:sig_usr: segfault in process pid: #2823

Closed pergolafabio closed 2 years ago

pergolafabio commented 2 years ago

OpenSIPS version you are running

opensips 3.2.6 (x86_64/linux)

Describe the bug Hi, i'm running a verry simple opensips system, based on 3.2.5 The only extra module loaded is the UAC registrant, all was working fine on 3.2.5 After upgrading, to 3.2.6 , as soon the UAC registrant is loaded, there is only 1 registrant configured, opensips crashes on boot... When i disable the UAC registrant, no crash, when we enable it again, => crash

To Reproduce Enable UAC registrant, insert 1 record, enable , reload

Expected behavior No crash

Relevant System Logs

Apr 26 22:34:14 [46] NOTICE:core:main: version: opensips 3.2.6 (x86_64/linux)
Apr 26 22:34:14 [46] NOTICE:core:main: using 32 MB of shared memory, allocator: F_MALLOC
Apr 26 22:34:14 [46] NOTICE:core:main: using 16 MB of private process memory, allocator: F_MALLOC
Apr 26 22:34:14 [46] WARNING:core:init_reactor_size: shrinking reactor size from 1048576 (autodetected via rlimit) to 41943 (limited by memory of 10% from 16Mb)
Apr 26 22:34:14 [46] WARNING:core:init_reactor_size: use 'open_files_limit' to enforce other limit or increase pkg memory
Apr 26 22:34:14 [46] INFO:core:init_reactor_size: reactor size 41943 (using up to 1.60Mb of memory per process)
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_CORE_THRESHOLD(0)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_CORE_SHM_THRESHOLD(1)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_CORE_PKG_THRESHOLD(2)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_CORE_PROC_AUTO_SCALE(3)>
Apr 26 22:34:14 [46] INFO:tm:mod_init: TM - initializing...
Apr 26 22:34:14 [46] INFO:sl:mod_init: Initializing StateLess engine
Apr 26 22:34:14 [46] NOTICE:signaling:mod_init: initializing module ...
Apr 26 22:34:14 [46] INFO:uac_registrant:load_reg_info_from_db: loading [1] records from db
Apr 26 22:34:14 [46] INFO:rr:mod_init: rr - initializing
Apr 26 22:34:14 [46] INFO:maxfwd:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:sipmsgops:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_MYSQL_CONNECTION(4)>
Apr 26 22:34:14 [46] INFO:usrloc:ul_init_locks: locks array size 512
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_AOR_INSERT(5)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_AOR_DELETE(6)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_CONTACT_INSERT(7)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_CONTACT_UPDATE(8)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_CONTACT_DELETE(9)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_CONTACT_REFRESH(10)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_UL_LATENCY_UPDATE(11)>
Apr 26 22:34:14 [46] INFO:registrar:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:acc:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_ACC_EVENT(12)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_ACC_CDR(13)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_ACC_MISSED_EVENT(14)>
Apr 26 22:34:14 [46] INFO:auth:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:auth_db:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:alias_db:mod_init: initializing...
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_PRESENCE_PUBLISH(15)>
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_PRESENCE_EXPOSED(16)>
Apr 26 22:34:14 [46] INFO:dialplan:mod_init: initializing module...
Apr 26 22:34:14 [46] INFO:drouting:dr_init: dynamic routing - initializing
Apr 26 22:34:14 [46] INFO:drouting:init_prefix_tree: counted 10 possible chars under a node
Apr 26 22:34:14 [46] INFO:core:evi_publish_event: Registered event <E_DROUTING_STATUS(17)>
Apr 26 22:34:14 [46] INFO:core:mod_init: initializing UDP-plain protocol
Apr 26 22:34:14 [46] INFO:core:mod_init: initializing TCP-plain protocol
Apr 26 22:34:14 [51] WARNING:dialplan:dp_load_db: no data in the db
Apr 26 22:34:14 [51] INFO:drouting:dr_reload_data_head: loading drouting data!
Apr 26 22:34:14 [51] NOTICE:drouting:dr_load_routing_info: loaded 0 gateways in partition 'Default'
Apr 26 22:34:14 [51] NOTICE:drouting:dr_load_routing_info: loaded 0 carriers in partition 'Default'
Apr 26 22:34:14 [51] NOTICE:drouting:dr_load_routing_info: loaded 0 rules in partition 'Default'
Apr 26 22:35:05 [63] CRITICAL:core:sig_usr: segfault in process pid: 63, id: 17
Apr 26 22:35:05 [46] INFO:core:handle_sigs: child process 63 exited by a signal 11
Apr 26 22:35:05 [46] INFO:core:handle_sigs: core was generated
Apr 26 22:35:05 [46] INFO:core:handle_sigs: terminating due to SIGCHLD
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 2(48) [MI FIFO] terminated, still waiting for 16 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 18(64) [TCP main] terminated, still waiting for 15 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 10(56) [TCP receiver] terminated, still waiting for 14 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 16(62) [TCP receiver] terminated, still waiting for 13 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 15(61) [TCP receiver] terminated, still waiting for 12 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 11(57) [TCP receiver] terminated, still waiting for 11 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 1(47) [HTTPD INADDR_ANY:8888] terminated, still waiting for 10 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 8(54) [SIP receiver udp:192.168.0.17:5060] terminated, still waiting for 9 more
Apr 26 22:35:05 [50] INFO:core:sig_usr: signal 15 received
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 4(50) [timer] terminated, still waiting for 8 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 13(59) [TCP receiver] terminated, still waiting for 7 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 14(60) [TCP receiver] terminated, still waiting for 6 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 9(55) [TCP receiver] terminated, still waiting for 5 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 6(52) [SIP receiver udp:192.168.0.17:5060] terminated, still waiting for 4 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 12(58) [TCP receiver] terminated, still waiting for 3 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 5(51) [SIP receiver udp:192.168.0.17:5060] terminated, still waiting for 2 more
Apr 26 22:35:05 [49] INFO:core:sig_usr: signal 15 received
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 7(53) [SIP receiver udp:192.168.0.17:5060] terminated, still waiting for 1 more
Apr 26 22:35:05 [46] INFO:core:shutdown_opensips: process 3(49) [time_keeper] terminated, still waiting for 0 more
Apr 26 22:35:05 [46] INFO:core:cleanup: cleanup
Apr 26 22:35:05 [46] NOTICE:presence:destroy: destroy module ...
Thank you for running opensips

OS/environment information OS: Debian 10 , with UAC registrant module

bogdan-iancu commented 2 years ago

@pergolafabio , try to extract and post here the bracktrace for your crash - see https://opensips.org/Documentation/TroubleShooting-Crash

pergolafabio commented 2 years ago

you need that core file?

pergolafabio commented 2 years ago

hmm, when i try that gdb command, it complmains, not exutable format ...

here is "core" file

https://www.dropbox.com/s/jsqvo2pmx935k6s/core?dl=0

bogdan-iancu commented 2 years ago

I do not need the core file (useless without the opensips binary and the opensips module libs) - just extract the BT as per instructions I mentioned . IF you get issues, post here the command you tried and its output.

pergolafabio commented 2 years ago

i used the command below, there is a "core" file , but the command "gdb /log/core" doesnt work sorry, linux a bit new to me

image

bogdan-iancu commented 2 years ago

do gdb /usr/bin/opensips /log/core

pergolafabio commented 2 years ago

is this usefull ?

image

bogdan-iancu commented 2 years ago

yes, but first install the opensips dbg pacakge (debug symbols). After that run full bt after entering gdb.

pergolafabio commented 2 years ago

hmm, undefined command?

image

pergolafabio commented 2 years ago

nm, its "bt full" , here is output:

Core was generated by `/usr/sbin/opensips -w /log start'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:440
440     ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) full bt
Undefined command: "full".  Try "help".
(gdb) bt full
#0  __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:440
No locals.
#1  0x000055fadab7fecd in memcpy (__len=1606732387, __src=<optimized out>, __dest=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
No locals.
#2  apply_msg_changes (max_offset=407, sock=0x7ff6a1fe9f30, orig_offs=0x7ffed04a7d00, new_offs=0x7ffed04a7cfc,
    new_buf=0x7ff6a04688d0 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFro                                                      m: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"..., msg=0x7ff6a20454c8) at msg_translator.c:1918
        size = 1606732387
        size = <optimized out>
#3  build_req_buf_from_sip_req (msg=msg@entry=0x7ff6a20454c8, returned_len=returned_len@entry=0x7ffed04a7de4, send_sock=0x7ff6a1fe9f30, proto=<optimized out>,
    via_params=via_params@entry=0x0, flags=flags@entry=3) at msg_translator.c:2328
        len = 407
        new_len = 608
        received_len = 0
        rport_len = 0
        uri_len = <optimized out>
        via_len = 3669530923
        body_delta = <optimized out>
        line_buf = <optimized out>
        received_buf = <optimized out>
        rport_buf = <optimized out>
        new_buf = 0x7ff6a04688d0 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\                                                      r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
        buf = 0x7ff6a03b3408 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nF                                                      rom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
        id_buf = <optimized out>
        offset = 445
        s_offset = 405
        size = <optimized out>
        id_len = 0
        anchor = <optimized out>
        via_insert_param = <optimized out>
        branch = {s = 0x0, len = -87699712}
        extra_params = {s = 0x0, len = 0}
        body = <optimized out>
        hp = {host = 0x7ff600000015, port = 0x7ff6a045f810}
        via1_deleted = <optimized out>
        __FUNCTION__ = "build_req_buf_from_sip_req"
#4  0x00007ff69fbca5fa in run_local_route (new_cell=new_cell@entry=0x7ff6a0466e60, buf=buf@entry=0x7ffed04a8210, buf_len=buf_len@entry=0x7ffed04a81fc,
    dialog=dialog@entry=0x7ff6a045f810, ret_req=ret_req@entry=0x7ffed04a8200, ret_req_buf=ret_req_buf@entry=0x7ffed04a8208) at uac.c:265
--Type <RET> for more, q to quit, c to continue without paging--
pergolafabio commented 2 years ago

Is it usefull? Is it a bug in 3.2.6 ? Because everything works on 3.2.5

Thnx

bogdan-iancu commented 2 years ago

Yes, that's useful, thank you. Once you are in GDB, please run:

f 2
p size
p *new_offs
p *orig_offs
pergolafabio commented 2 years ago

here you go, i also added again the bt full, seems previous post was incomplete....


(gdb) f 2
#2  apply_msg_changes (max_offset=407, sock=0x7ff6a1fe9f30, orig_offs=0x7ffed04a7d00, new_offs=0x7ffed04a7cfc,
    new_buf=0x7ff6a04688d0 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"..., msg=0x7ff6a20454c8) at msg_translator.c:1918
1918    msg_translator.c: No such file or directory.
(gdb) p size
$1 = 1606732387
(gdb) p *new_offs
$2 = 445
(gdb) p *orig_offs
$3 = 405
(gdb)
                                                                                                                                                    r directory.
(gdb) bt full
#0  __memmove_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:440
No locals.
#1  0x000055fadab7fecd in memcpy (__len=1606732387, __src=<optimized out>, __dest=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
No locals.
#2  apply_msg_changes (max_offset=407, sock=0x7ff6a1fe9f30, orig_offs=0x7ffed04a7d00, new_offs=0x7ffed04a7cfc,
    new_buf=0x7ff6a04688d0 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"..., msg=0x7ff6a20454c8) at msg_translator.c:1918
        size = 1606732387
        size = <optimized out>
#3  build_req_buf_from_sip_req (msg=msg@entry=0x7ff6a20454c8, returned_len=returned_len@entry=0x7ffed04a7de4, send_sock=0x7ff6a1fe9f30, proto=<optimized out>, via_params=via_params@entry=0x0, flags=flags@entry=3)
    at msg_translator.c:2328
        len = 407
        new_len = 608
        received_len = 0
        rport_len = 0
        uri_len = <optimized out>
        via_len = 3669530923
        body_delta = <optimized out>
        line_buf = <optimized out>
        received_buf = <optimized out>
        rport_buf = <optimized out>
        new_buf = 0x7ff6a04688d0 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
        buf = 0x7ff6a03b3408 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
        id_buf = <optimized out>
        offset = 445
        s_offset = 405
        size = <optimized out>
        id_len = 0
        anchor = <optimized out>
        via_insert_param = <optimized out>
        branch = {s = 0x0, len = -87699712}
        extra_params = {s = 0x0, len = 0}
        body = <optimized out>
        hp = {host = 0x7ff600000015, port = 0x7ff6a045f810}
        via1_deleted = <optimized out>
        __FUNCTION__ = "build_req_buf_from_sip_req"
#4  0x00007ff69fbca5fa in run_local_route (new_cell=new_cell@entry=0x7ff6a0466e60, buf=buf@entry=0x7ffed04a8210, buf_len=buf_len@entry=0x7ffed04a81fc, dialog=dialog@entry=0x7ff6a045f810, ret_req=ret_req@entry=0x7ffed04a8200,
    ret_req_buf=ret_req_buf@entry=0x7ffed04a8208) at uac.c:265
        req = 0x7ff6a20454c8
        backup_cell = <optimized out>
        backup_route_type = <optimized out>
        request = <optimized out>
        new_proxy = <optimized out>
        new_to_su = {s = {sa_family = 0, sa_data = '\000' <repeats 13 times>}, sin = {sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, sin6 = {sin6_family = 0, sin6_port = 0,
            sin6_flowinfo = 0, sin6_addr = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}}
        new_send_sock = <optimized out>
        dst_changed = <optimized out>
        buf1 = 0x0
        sipmsg_buf = <optimized out>
        buf_len1 = 32766
        sip_msg_len = -1606027024
        h_to = {s = 0x7ff6a045f8f8 "\025", len = 0}
        h_from = {s = 0x0, len = -1615030147}
        h_cseq = {s = 0x7ffed04a0000 "", len = 0}
        h_callid = {s = 0x7ffed04a7f80 "", len = -1614951806}
        __FUNCTION__ = "run_local_route"
#5  0x00007ff69fbcbf32 in t_uac (method=0x7ff69ffde670 <register_method>, headers=0x7ff69ffde850 <extra_hdrs>, body=0x0, dialog=0x7ff6a045f810, cb=<optimized out>, cbp=<optimized out>, release_func=0x7ff69ffd3400 <osips_shm_free>)
    at uac.c:511
        to_su = {s = {sa_family = 2, sa_data = "\023\311\300\250\000G\000\000\000\000\000\000\000"}, sin = {sin_family = 2, sin_port = 51475, sin_addr = {s_addr = 1191225536}, sin_zero = "\000\000\000\000\000\000\000"}, sin6 = {
            sin6_family = 2, sin6_port = 51475, sin6_flowinfo = 1191225536, sin6_addr = {__in6_u = {__u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}, sin6_scope_id = 0}}
        new_cell = 0x7ff6a0466e60
--Type <RET> for more, q to quit, c to continue without paging--
        request = 0x7ff6a0467038
        req = 0x0
        buf_req = 0x0
        backup = 0x55fadaed0418 <global_avps>
        buf = 0x7ff6a03b3408 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
        buf_len = 407
        ret = -1
        flags = <optimized out>
        hi = <optimized out>
        proxy = 0x7ff6a2045218
        __FUNCTION__ = "t_uac"
#6  0x00007ff69fbcd046 in req_within (method=<optimized out>, headers=<optimized out>, body=<optimized out>, dialog=<optimized out>, completion_cb=<optimized out>, cbp=<optimized out>, release_func=0x7ff69ffd3400 <osips_shm_free>)
    at uac.c:615
        __FUNCTION__ = "req_within"
#7  0x00007ff69ffd5114 in send_register (hash_index=hash_index@entry=0, rec=rec@entry=0x7ff6a045f810, auth_hdr=auth_hdr@entry=0x0) at registrant.c:814
        result = <optimized out>
        expires_len = <optimized out>
        cb_param = 0x7ff6a045be38
        p = <optimized out>
        expires = <optimized out>
        __FUNCTION__ = "send_register"
#8  0x00007ff69ffd75ef in run_timer_check (e_data=0x7ff6a045f810, data=<optimized out>, r_data=<optimized out>) at registrant.c:949
        rec = <optimized out>
        t_check_data = <optimized out>
        now = 1651567542
        s_now = 0x7ffed04a83d0
        i = 0
        __FUNCTION__ = "run_timer_check"
#9  0x000055fadac94b64 in slinkedl_traverse (list=<optimized out>, func=func@entry=0x7ff69ffd7570 <run_timer_check>, data=data@entry=0x7ffed04a83e0, r_data=r_data@entry=0x0) at lib/sliblist.c:132
        ret = <optimized out>
        element = 0x7ff6a045f800
#10 0x00007ff69ffd4aea in timer_check (ticks=<optimized out>, hash_counter=<optimized out>) at registrant.c:988
        i = <optimized out>
        ret = <optimized out>
        now = <optimized out>
        str_now = {s = 0x7ff6a2045450 "1651567542", len = 10}
        t_check_data = {now = 1651567542, s_now = 0x7ffed04a83d0, hash_counter = 0}
        __FUNCTION__ = "timer_check"
#11 0x000055fadabdab9a in handle_timer_job () at timer.c:857
        t = 0x7ff6a03b3728
        l = <optimized out>
        __FUNCTION__ = "handle_timer_job"
#12 0x000055fadabdbcc5 in handle_io (idx=1, event_type=1, fm=0x7ff6a2037310) at timer.c:653
        n = 0
        n = <optimized out>
        __FUNCTION__ = "handle_io"
#13 io_wait_loop_epoll (repeat=0, t=1, h=<optimized out>) at io_wait_loop.h:305
        ret = <optimized out>
        n = <optimized out>
        r = 1
        i = <optimized out>
        e = 0x7ff6a2037310
        ep_event = {events = 3671183939, data = {ptr = 0x100005500, fd = 21760, u32 = 21760, u64 = 4294989056}}
        fd = <optimized out>
        curr_time = 50
        __FUNCTION__ = "io_wait_loop_epoll"
#14 0x000055fadabdf0a1 in start_timer_extra_processes (chd_rank=chd_rank@entry=0x55fadaed0428 <chd_rank>) at timer.c:812
        i = <optimized out>
        p_id = <optimized out>
        __FUNCTION__ = "start_timer_extra_processes"
#15 0x000055fadab5ba2d in main_loop () at main.c:239
        startup_done = 0x0
--Type <RET> for more, q to quit, c to continue without paging--
        last_check = 0
        rc = <optimized out>
        chd_rank = 13
        startup_done = <optimized out>
        last_check = <optimized out>
        rc = <optimized out>
        __FUNCTION__ = "main_loop"
#16 main (argc=<optimized out>, argv=<optimized out>) at main.c:916
        c = <optimized out>
        r = 0
        tmp = 0x7ffed04a86b6 ""
        tmp_len = <optimized out>
        port = <optimized out>
        proto = <optimized out>
        protos_no = <optimized out>
        options = 0x55fadad209b8 "f:cCm:M:b:l:n:N:rRvdDFEVhw:t:u:g:p:P:G:W:o:a:k:s:"
        seed = 1016472228
        rfd = <optimized out>
        __FUNCTION__ = "main"
(gdb)
bogdan-iancu commented 2 years ago

hmm, this looks related to 2d49e1f3a89b751942c1b6340355edb38ef6446c, on a first glance please do

p msg->body
p *msg->body
p msg->buf
p *orig_offs

It is weird why there is a body there, as this is a REGISTER....it should be none

pergolafabio commented 2 years ago

No, i have added a body in my .cfg file, thats the reason why i use opensips, i need to append a body part

local_route {
    if ( is_method("REGISTER") ) {
        append_hf("Expires: 900\r\n");
        add_body_part("<regXML>\n<version>V2.0.0</version>\n<regDevName>181</regDevName>\n<regDevSerial>Q05659369</regDevSerial>\n<regDevMacAddr>00:0c:29:fa:48:51</regDevMacAddr>\n</regXML>", "text/xml");

    }

Here is the output:

(gdb) p msg->body
$11 = (struct sip_msg_body *) 0x7ff6a2046a50
(gdb) p *msg->body
$12 = {part_count = 0 '\000', updated_part_count = 1 '\001', flags = 1 '\001', body = {s = 0x0, len = 0}, boundary = {s = 0x0, len = 0}, first = {mime = 0, mime_s = {
      s = 0x7ff6a2046af0 "text/xml<regXML>\n<version>V2.0.0</version>\n<regDevName>181</regDevName>\n<regDevSerial>Q05659369</regDevSerial>\n<regDevMacAddr>00:0c:29:fa:48:51</regDevMacAddr>\n</regXML>", len = 8}, flags = 1, body = {
      s = 0x7ff6a2046af8 "<regXML>\n<version>V2.0.0</version>\n<regDevName>181</regDevName>\n<regDevSerial>Q05659369</regDevSerial>\n<regDevMacAddr>00:0c:29:fa:48:51</regDevMacAddr>\n</regXML>", len = 161}, headers = {s = 0x0,
      len = 0}, parsed = 0x0, free_parsed_f = 0x0, clone_parsed_f = 0x0, dump_f = 0x0, dump = {s = 0x0, len = 0}, next = 0x0}}
(gdb) p msg->buf
$13 = 0x7ff6a03b3408 "REGISTER sip:192.168.0.71:5065 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.0.181:5061;branch=z9hG4bKfc83.39ea5676.0\r\nTo: sip:10000000004@192.168.0.71:5065\r\nFrom: <sip:10000000004@192.168.0.71:5065>;tag=650d1\r\nC"...
(gdb) p *orig_offs
bogdan-iancu commented 2 years ago

oh, I see, you do add the body from local route - let me test this case

pergolafabio commented 2 years ago

Do you have an update for me?

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

pergolafabio commented 2 years ago

Please leave open

bogdan-iancu commented 2 years ago

@pergolafabio , I will try to run some tests these days

pergolafabio commented 2 years ago

Perfect, keep me posted :+)

Thnx in advance

bogdan-iancu commented 2 years ago

@pergolafabio , I managed to reproduce and fix the issue, see the above commit - could you also validate the fix please?

pergolafabio commented 2 years ago

Hey @bogdan-iancu thnx for the fix But i run opensips in a docker container, dont think i can just change the file? dont think so i guess i need to wait for 3.2.7 ? i will confirm

bogdan-iancu commented 2 years ago

I guess you will have to use the OpenSIPS nightly build for 3.2 with your image, so you can have access to the latest fixes.

Like https://apt.opensips.org/pool/jammy/3.2-nightly/o/opensips/

pergolafabio commented 2 years ago

ok, installed nightly, that works indeed!

thnx for fix, will it be included in 3.2.7 ?

bogdan-iancu commented 2 years ago

yes, it will be part of the next minor releases on all maintained branches.

pergolafabio commented 2 years ago

perfect, thnx for the fix, appreciated!