[kamailio/kamailio] Do not start Kamailio if no listener address is configured (#1098)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[kamailio/kamailio] Do not start Kamailio if no listener address is configured (#1098)

lazedo-2

Description

During some test on my server I forgot to configure a valid listen network address. It's my fault but Kamailio crashed with a useless message:

kamailio[4739]: segfault at 0 ip 00007f022ede5e71 sp 00007fff94033f08 error 4 in libc-2.17.so[7f022ec82000+1b6000

I think it's better to abort the startup if no listen address is specified and with an explicit error message, instead of produce a segfault and a crash without any error


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Do not start Kamailio if no listener address is configured (#1098)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2

Likely this is due to a module cleaning up some uninitialized structure, because kamailio should deal nicely when the listen address cannot be found.

To see where the issue resides, it is good to have a core dump and get the backtrace. Be sure you set ulimit -c ulimited in terminal and start kamailio as root. Once you get the core file, grab the backtrace with gdb and paste it here. If you installed from packages, then you may need to install debug info package in order to get useful backtrace.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1098: Likely this is due to a module cleaning up some uninitialized structure, because kamailio should deal nicely when the listen address cannot be found.\r\n\r\nTo see where the issue resides, it is good to have a core dump and get the backtrace. Be sure you set `ulimit -c ulimited` in terminal and start kamailio as root. Once you get the core file, grab the backtrace with gdb and paste it here. If you installed from packages, then you may need to install debug info package in order to get useful backtrace."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-297716799"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2
#0  0x00007ffff7761e71 in __strlen_sse2_pminub () from /lib64/libc.so.6
#1  0x00007ffff32c62c4 in uac_init () at uac.c:96
#2  0x00007ffff32ac665 in mod_init () at tm.c:782


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@sarbyn in #1098: ```\r\n#0 0x00007ffff7761e71 in __strlen_sse2_pminub () from /lib64/libc.so.6\r\n#1 0x00007ffff32c62c4 in uac_init () at uac.c:96\r\n#2 0x00007ffff32ac665 in mod_init () at tm.c:782\r\n```\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-297922356"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2

What version of kamailio are you using? The code seems to be safe there.

I also tried to reproduce by having a listen with a non local ip and it didn't crash, it prints the error message and exits:

ERROR: <core> [core/udp_server.c:397]: udp_init(): bind(6, 0x10c606504, 16) on 192.168.178.188: Can't assign requested address


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1098: What version of kamailio are you using? The code seems to be safe there.\r\n\r\nI also tried to reproduce by having a listen with a non local ip and it didn't crash, it prints the error message and exits:\r\n\r\n```\r\nERROR: \u003ccore\u003e [core/udp_server.c:397]: udp_init(): bind(6, 0x10c606504, 16) on 192.168.178.188: Can't assign requested address\r\n```\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-299235547"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2

version: kamailio 5.0.1 (x86_64/linux)
Tip to reproduce: enable TLS but do not define any "listen=" addresses


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@sarbyn in #1098: version: kamailio 5.0.1 (x86_64/linux)\r\nTip to reproduce: enable TLS but do not define any \"listen=\" addresses"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-299400535"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2

this is the good functionality of kamailio if no listen is mentioned then kamailio listen to local interface.
But as you are not getting proper log. we will try to reproduce it and if we found the issue then we will print the error log on this.so you can identify what things are wrong with config.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@SurendraPlivo in #1098: this is the good functionality of kamailio if no listen is mentioned then kamailio listen to local interface.\r\nBut as you are not getting proper log. we will try to reproduce it and if we found the issue then we will print the error log on this.so you can identify what things are wrong with config."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-303960612"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2

I was not able to reproduce. I did a fresh install and started with default kamailio.cfg that has WITH_TLS defined. All started fine, the kamctl srv sockets shows that kamailio is listening on tls.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1098: I was not able to reproduce. I did a fresh install and started with default `kamailio.cfg` that has `WITH_TLS` defined. All started fine, the `kamctl srv sockets` shows that `kamailio` is listening on tls."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-308108648"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [kamailio/kamailio] Do not start Kamailio if no listen address is configured (#1098)

lazedo-2
In reply to this post by lazedo-2

If there are no other details that you can provide, like all log messages with debug=3 in kamailio.cfg or output of bt full, I am closing this one in the near future, being not able to reproduce it here.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1098: If there are no other details that you can provide, like all log messages with debug=3 in kamailio.cfg or output of `bt full`, I am closing this one in the near future, being not able to reproduce it here."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1098#issuecomment-310851704"}}}</script>
_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Loading...