Closed pergolafabio closed 2 years ago
@pergolafabio , try to extract and post here the bracktrace for your crash - see https://opensips.org/Documentation/TroubleShooting-Crash
you need that core file?
hmm, when i try that gdb command, it complmains, not exutable format ...
here is "core" file
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.
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
do gdb /usr/bin/opensips /log/core
is this usefull ?
yes, but first install the opensips dbg pacakge (debug symbols). After that run full bt
after entering gdb.
hmm, undefined command?
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--
Is it usefull? Is it a bug in 3.2.6 ? Because everything works on 3.2.5
Thnx
Yes, that's useful, thank you. Once you are in GDB, please run:
f 2
p size
p *new_offs
p *orig_offs
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)
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
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
oh, I see, you do add the body from local route - let me test this case
Do you have an update for me?
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.
Please leave open
@pergolafabio , I will try to run some tests these days
Perfect, keep me posted :+)
Thnx in advance
@pergolafabio , I managed to reproduce and fix the issue, see the above commit - could you also validate the fix please?
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
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/
ok, installed nightly, that works indeed!
thnx for fix, will it be included in 3.2.7 ?
yes, it will be part of the next minor releases on all maintained branches.
perfect, thnx for the fix, appreciated!
OpenSIPS version you are running
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
OS/environment information OS: Debian 10 , with UAC registrant module