[SR-Users] Kamailio 5.4.4 segmentation fault after kamctl rpc dialplan.dump

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 22 14:37:25 CET 2021


Hello,

probably the module code needs also some updates, it is rather old and
likely designed for db backends that enforce non-null values, like in
the create statement:

  *
https://github.com/kamailio/kamailio/blob/master/utils/kamctl/mysql/dialplan-create.sql#L10

So it does not do much extra checks in the code, but these days there
are other db connectors that may not have strict schema implementation
like db_redis or db_mongodb.

For now, I pushed a push a patch to jsonrpcs module to print 'null'
value in jsonrpc response, when the value passed from other modules to
it is C-NULL. This should prevent (hopefully) the crash from happening,
even you revert back to have null value in database:

  *
https://github.com/kamailio/kamailio/commit/c48e409b741821fa470788b3bca0ead32e4d6efc

I will have to check the ctl and xmlrpc modules to see what they do in
similar cases, to cover also the use of kamcmd for the same situation.

Cheers,
Daniel

On 22.02.21 13:50, Julia Bo wrote:
> Hello Daniel,
>
> I use mysqldb. 
> I have added the default value "" to column "attr" and It's working now.
>
> Thank you so much!  
> Julia.
>
>
> On Mon, Feb 22, 2021 at 12:19 PM Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>     Hello,
>
>     did you change the database structure? Because the crash seems to
>     be because attrs field is NULL, but database schema should prevent
>     it. Or, maybe you use a database backend that cannot enforce that,
>     which one do you use (db_myql, ...)?
>
>     Cheers,
>     Daniel
>
>     On 22.02.21 10:57, Daniel-Constantin Mierla wrote:
>>
>>     Hello,
>>
>>     ohhh, indeed -- I thought it was the corefile itself, which
>>     cannot be investigated on other system than the one generating it.
>>
>>     Cheers,
>>     Daniel
>>
>>     On 22.02.21 10:05, Julia Bo wrote:
>>>     Hello,
>>>
>>>     The corefile has been already attached in previous mail.
>>>     Send it again.
>>>
>>>     Thank you,
>>>     Julia.
>>>
>>>     On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla
>>>     <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>>>
>>>         Hello,
>>>
>>>         are you able to get a core file for the crash? If yes, then
>>>         send here the output of gdb command "bt full" to see where
>>>         the crash happens and try to fix it.
>>>
>>>         Cheers,
>>>         Daniel
>>>
>>>         On 21.02.21 16:11, Julia Bo wrote:
>>>>         Hello,
>>>>         Kamailio version 5.4.4.
>>>>         Kamailio  segmentation fault after kamctl rpc dialplan.dump
>>>>         <dpid>,
>>>>         when dialplan includes variables in the replacement
>>>>         expression (repl_exp) field.
>>>>         Please see attached corefile.
>>>>
>>>>         Thank you,
>>>>         Julia.
>>>>
>>>>         _______________________________________________
>>>>         Kamailio (SER) - Users Mailing List
>>>>         sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>>>>         https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>>
>>>         -- 
>>>         Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>>>         www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>>>         Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>>>
>>     -- 
>>     Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>>     www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>>     Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>
>     -- 
>     Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>     www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>     Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210222/53bee1ab/attachment.htm>


More information about the sr-users mailing list