New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault when processing select variable via kemi #1829
Comments
Did you set Can you provide from gdb the output for:
|
No, this parameter is not set, it should have the default value. |
@miconda not sure if it's useful but i tried to start kamailio with the mentioned route_locks_size but could not get it up (tried with values 1,2,8,16,20).
|
You haven't provided the output of the gdb commands I listed in my previous comment, I need to see what's there to be able to troubleshoot further. |
Sorry, i overlooked it. Output is:
|
That should be NULL (0x0) by default, so somewhere is an invalid write/buffer overflow. Can you just start kamailio with your config, but do not send any sip traffic to it -- just attach with gdb to one of the processes running there and do the same commands as above to see if the overwrite happens at startup or at runtime? |
Ok, i attached to a random child and i get the expected output:
Strange. Can i check for some specific included module or is there some other global config that might affect this setting? |
@miconda, i was able to isolate the problem to a single line of python script. Segfault happens when i use this selector within ksr_reply_route:
a simpler As stated above, the segfault happens after so and so many packets (typically 14-20) but the pace of the messages seems to play a role as well. Hope it helps! Cheers, Thomas |
Trying to understand how I can reproduce it in order to troubleshoot ... So, I have to use At the first thought, should not be a KEMI export issue, but a |
Daniel, i will shrink the script as much as possible and then i can surely provide a full test case incl. sipp scenarios. Give me a few days, though. |
I prepared some files in a zip: https://drive.google.com/open?id=1qVap6BhbGpJwHL-Gf3aUCBOSSbekscs5 including some instructions on how to reproduce. Kamailio config is down to 15 lines (5 modules only) and the python script is also bare bones with about 30 lines. It boils down to:
I did a few more checks, also. One initial assumption about the problem was wrong. Good luck hunting it down :-) |
- reset the select static buffer - GH #1829
Thanks for the instructions to reproduce the issue, it helped to identify the problem and fix it. Select required some function to be executed in order to initialize some of its internal buffers and it didn't happen when executing kemi scripts. I pushed fixes to master branch, I am going to backport to stable branches these days. If you want to test with master branch right now, let me know the results in your side. |
@miconda great! Glad i could help. Cheers |
Hi,
we have crashes on some of our kamailio hosts:
Problem
Kamailio segfaults when processing tcp replies.
Config file and use case
We're running a somewhat complex Kemi/python configuration. It routes internal udp traffic from Asterisk to PSTN providers with various protocols (udp/tcp/tls).
I was able to isolate the problem on a test rig to a simple test setup. It happens if kamailio uses a outgoing tcp socket, udp is not affected.
The segfault occurs always after approx. 12-13 register/auth/ok cycles (8 packets, each). No other messages or calls are involved at all. I can reproduce the case now with a short register timeout within 4-5 minutes.
Registers are not directly processed in kamailio (no usrloc at al).
A downgrade to 5.1.6 shows a similar problem.
Kamailio version / os
Prebuilt 5.2.1 from deb.kamailio.org in a Ubuntu 16.04 lxc container.
kamailio -V
gdb debug info
Core dumps where analyzed with the source and dbg packages from deb.kamailio.org.
(gdb) list
(gdb) bt full
Let me know if you need more info, i can fully reproduce the problem.
Cheers,
Thomas
The text was updated successfully, but these errors were encountered: