Hi Daniel,

 

I was able to recreate the Issue with the newer version (4.1.6). Please find attached Kamailio configuration and sip-invite. (Please change modules path according to installation)

The attached Kamailio configuration is a (very) simplified configuration we are running in production.

 

 

10.10.207.20 is a server running the attached Kamailio configuration.

10.10.210.71 is a server running sipsak, sending the attached invite.

 

sipsak -s sip:10.10.207.20:5060 -f invite.txt

 

The crash seems to occur due to a missing exit of the configuration loop. So to get rid of the crash I would break the loop if $rU equals null after modification in MODIFY_NUMBER.

 

The issue now simplifies to:

You cannot empty $rU when a password is set, because the URI becomes invalid due to missing @: bad uri <sip::pass10.10.207.20>

 

 

Dec  4 13:27:50 /sbin/kamailio[8043]: NOTICE: <script>: ru initial: sip:123456:pass@10.10.207.20

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: NOTICE: <script>: rU set to: <null>

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:236]: pv_get_ruri(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: NOTICE: <script>: ru set to: <null>

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [action.c:805]: do_action(): ERROR: do_action: bad uri <sip::pass10.10.207.20>, dropping packet

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [action.c:1553]: do_action(): run action error at: :0

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:2080]: pv_set_ruri_user(): do action failed

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [lvalue.c:363]: lval_pvar_assign(): setting pvar failed

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [lvalue.c:416]: lval_assign(): assignment failed at pos: (49,11-49,21)

 

This loops:

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: NOTICE: <script>: rU set to: <null>

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:236]: pv_get_ruri(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: NOTICE: <script>: ru set to: <null>

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [lvalue.c:356]: lval_pvar_assign(): non existing right pvar

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [action.c:805]: do_action(): ERROR: do_action: bad uri <sip::pass10.10.207.20>, dropping packet

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [action.c:1553]: do_action(): run action error at: :0

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: pv [pv_core.c:2059]: pv_set_ruri_user(): do action failed)

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [lvalue.c:363]: lval_pvar_assign(): setting pvar failed

Dec  4 13:27:50 /sbin/kamailio[8043]: ERROR: <core> [lvalue.c:416]: lval_assign(): assignment failed at pos: (46,11-46,26)

 

 

 

 

Kind regards

Timo Klecker

 

 

Von: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] Im Auftrag von Daniel-Constantin Mierla
Gesendet: Montag, 1. Dezember 2014 23:35
An: Kamailio (SER) - Users Mailing List
Betreff: Re: [SR-Users] Kamailio Crash when modifying username of Request Uri

 

Hello,

the version is indeed very old -- however, you got a core dump, according to the logs, maybe you can send over the backtrace to see where it crashed.

Cheers,
Daniel

On 28/11/14 18:05, Timo Klecker wrote:

Hi all!
 
Our Kamailio (3.1.4) crashed when modifying the username-Part of a Request
URI using:
 
$rU = $(rU{s.strip,6});
 
Initial Request URI:
/sbin/kamailio[40658]: NOTICE: <script>: [ INVITE ] Got new Packet to
sip:123456:pass@sip.custom.com
 
The config-script now removed the first 6 chars from the username part and
would replace them in one of the following lines, but Kamailio had problems
here:
 
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI
/sbin/kamailio[40658]: NOTICE: <script>:  Strip from Head: Request Username:
<null>  //  $rU
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI
/sbin/kamailio[40658]: ERROR: <core> [action.c:801]: ERROR: do_action: bad
uri <sip::passsip.custom.com>, dropping packet
 
 
Is there maybe a error when modifying a uri with password this way? Do we
have to change this?
 
 
 
 
Ultimately Kamailio crashed:
/sbin/kamailio[40658]: ERROR: <core> [action.c:1513]: run action error at:
:0
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:1761]: do action failed
/sbin/kamailio[40658]: ERROR: <core> [lvalue.c:358]: setting pvar failed
/sbin/kamailio[40658]: ERROR: <core> [lvalue.c:411]: assignment failed at
pos: (319,10-319,34)
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI
 
Like 5000 lines more of
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI
Due to rerouting internal and trying to remove more parts of the request Uri
using $rU = $(rU{s.strip,6});
 
Which then concluded to the following: 
/sbin/kamailio[40656]: ALERT: <core> [main.c:741]: child process 40660
exited by a signal 11
/sbin/kamailio[40656]: ALERT: <core> [main.c:744]: core was generated
/sbin/kamailio[40656]: INFO: <core> [main.c:756]: INFO: terminating due to
SIGCHLD
/sbin/kamailio[40659]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI
/sbin/kamailio[40682]: INFO: <core> [main.c:807]: INFO: signal 15 received
/sbin/kamailio[40677]: INFO: <core> [main.c:807]: INFO: signal 15 received
/sbin/kamailio[40676]: INFO: <core> [main.c:807]: INFO: signal 15 received
/sbin/kamailio[40678]: INFO: <core> [main.c:807]: INFO: signal 15 received
[...]
 
 
I will try to recreate this using the new version (4.1.6) on monday. 
 
 
Kind regards
 
Timo Klecker 
 
 




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda