[sr-dev] [kamailio/kamailio] cfgutils: KEMI wrappers segfault as missing sig_msg_t* first argument (#1459)

aalba6675 notifications at github.com
Wed Feb 28 10:29:00 CET 2018


<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests.

If you have questions about using Kamailio or related to its configuration file,
ask on sr-users mailing list:

  * http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

If you have questions about developing extensions to Kamailio or its existing
C code, ask on sr-dev mailing list

  * http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Please try to fill this template as much as possible for any issue. It helps the
developers to troubleshoot the issue.

If you submit a feature request (or enhancement), you can delete the text of
the template and only add the description of what you would like to be added.

If there is no content to be filled in a section, the entire section can be removed.

You can delete the comments from the template sections when filling.

You can delete next line and everything above before submitting (it is a comment).
-->

### Description

<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
Use KEMI cfgutils.lock() and cfgutils.unlock().

Expect native behaviour of lock() unlock().

Instead segfault.


### Troubleshooting
The KEMI wrappers do not have leading sip_msg_t* argument.

Wrapper for lock() is cfg_lock()

Prototype for cfg_lock() is static int cfg_lock(str *lkey). Notice the missing sig_msg_t * first argument.




#### Reproduction
Call cfgutils.lock() cfgutils.unlock() from scripting language



#### Debugging Data
#0  0x00007fdc6e7eff32 in core_case_hash (s1=0x7fdcb88ac1a0, s2=0x0, size=16) at ../../core/hashes.h:317
317                     v=(ch_icase(*p)<<24)+(ch_icase(p[1])<<16)+(ch_icase(p[2])<<8)

s1 is actually the sip_msg_t* not the lock key string.
*s1 can actually be deferenced as *(sip_msg_t*) s1

#### Log Messages
#### SIP Traffic

### Possible Solutions
KEMI wrappers for cfgutils.c should include dummy sip_msg_t* argument.

### Additional Information

  * 5.0 5.1 master - kamailio version


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180228/1d3beae3/attachment.html>


More information about the sr-dev mailing list