[OpenSIPS-Users] uac_replace_to segmentation fault

Răzvan Crainea razvan at opensips.org
Thu Jan 9 08:55:47 CET 2014


Hi, Samuel!

What value are you using for the restore_mode[1] parameter?

[1] http://www.opensips.org/html/docs/modules/1.10.x/uac#id249006

Best regards,

Razvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 01/08/2014 04:37 PM, Samuel Muller wrote:
> Hello back,
>
> Thanks Ovidiu -  I reproduced the problem with the other function
> "uac_replace_from" too, in a x86 server, OpenSips 1.10 tls..
>
> here you can find the bt full of gdb :
>
>
> GNU gdb (GDB) 7.4.1-debian
> This GDB was configured as "x86_64-linux-gnu".
> Reading symbols from /usr/lib/debug/usr/sbin/opensips...done.
> [New LWP 28352]
> warning: Can't read pathname for load map: Input/output error.
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `/usr/sbin/opensips -P
> /var/run/opensips/opensips.pid -m 256 -M 8 -u opensips -g opensips'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x0000000000000000 in ?? ()
>
> (gdb) bt full
> #0  0x0000000000000000 in ?? ()
> No symbol table info available.
> #1  0x00007fe8e4c8bcb9 in replace_uri (msg=msg at entry=0x7fe8edf0ef88,
> display=display at entry=0x7fff7c55b6a0, uri=uri at entry=0x7fff7c55b690,
> hdr=<optimized out>, to=44, to at entry=0) at replace.c:432
>          buf_s =
> "\000\000\000\000\002\003\b\004\002u_UBV]n\005G\031L\004A\036\021\027A\024\034\b.com",
> '\000' <repeats 990 times>
>          body = <optimized out>
>          l = <optimized out>
>          Trans = <optimized out>
>          rr_param = 0x7fe8e4e914d0
>          p = <optimized out>
>          param = {s = 0x7fe8edf12930
> ";vsf=AAAAAAIDCAQCdV9VQlZdbgVHGUwEQR4RF0EUHAguY29t", len = 49}
>          buf = {s = 0x7fe8e4e91b20 "", len = <optimized out>}
>          uac_flag = 64
>          i = <optimized out>
>          dlg = 0x0
>          val = {rs = {s = 0x7fe8d4670db0
> "sip:33170567631 at sip.v.mydomain.com", len = 33}, ri = 0, flags = 4}
>          __FUNCTION__ = "replace_uri"
> #2  0x00007fe8e4c8df44 in w_replace_from (msg=0x7fe8edf0ef88,
> p1=<optimized out>, p2=<optimized out>) at uac.c:389
>          uri_s = {s = 0x7926a0 "sip:33170567631 at sip.v.mydomain.com", len = 33}
>          dsp_s = {s = 0x7922a0 "\"+33170567631\"", len = 14}
>          uri = 0x7fff7c55b690
>          dsp = 0x7fff7c55b6a0
>          __FUNCTION__ = "w_replace_from"
> #3  0x000000000041c5f0 in do_action (a=0x7fe8edec71e0,
> msg=0x7fe8edf0ef88) at action.c:1715
>          val_s = {s = 0x7fe8d466f6b8 "33170567631", len = 0}
>          aux_counter = <optimized out>
>          i = <optimized out>
>          avp_val = {n = 5377812, s = {s = 0x303200520f14 <Address
> 0x303200520f14 out of bounds>, len = -302977144}}
>          j = <optimized out>
>          key_number = <optimized out>
>          adv_addr = {s = 0x7fe8d466f6b8 "33170567631", len = 0}
>          increment = <optimized out>
>          decrement = <optimized out>
>          avp_type = <optimized out>
>          aux = {s = 0x7fe8d466f6b8 "33170567631", len = 0}
>          cdb_reply = <optimized out>
>          val_number = <optimized out>
>          it = <optimized out>
>          avp_name = {n = -303274568, s = {s = 0x7fe8edec65b8 "", len =
> -302994552}}
>          ret = -5
>          v = <optimized out>
>          to = <optimized out>
>          p = <optimized out>
>          tmp = <optimized out>
>          new_uri = <optimized out>
>          end = <optimized out>
>          crt = <optimized out>
>          len = <optimized out>
>          i = <optimized out>
>          user = 0
>          expires = 0
>          vals = {{s = 0x7fe8d466f6b8 "33170567631", len = 0}, {s =
> 0x7fff7c55b8c0 "\270\366f\324\350\177", len = -302994552}, {s = 0x0,
> len = -303274160}, {s = 0x0, len = 4613869}, {s = 0x7fe8edec6750
> "\005", len = 0}}
>          result = {s = 0x1ef4160 "<183>Jan  8 14:23:20 opensips[28352]:
> DBG:uac:replace_uri: encode
> is=<AAAAAAIDCAQCdV9VQlZdbgVHGUwEQR4RF0EUHAguY29t> len=44\n", len = 0}
>          uri = {user = {s = 0x7fe8edf0ef88 "\001", len = 4523101},
> passwd = {s = 0x323533383255b8d0 <Address 0x323533383255b8d0 out of
> bounds>, len = 4}, host = {s = 0x16 <Address 0x16 out of bounds>, len
> = 5}, port = {
>              s = 0x7fe8edec6750 "\005", len = 0}, params = {s =
> 0x7fe8edf0ef88 "\001", len = 4629851}, headers = {s = 0x7fff7c55b9c0
> "P\272U|\377\177", len = 4300136}, port_no = 32, proto = 0, type =
> ERROR_URI_T, transport = {
>              s = 0x7922a0 "\"+33170567631\"", len = 2085992912}, ttl =
> {s = 0x7fe8eebc0e60 "", len = -731449672}, user_param = {s = 0xb
> <Address 0xb out of bounds>, len = 0}, maddr = {s = 0x0, len =
> -731449672}, method = {
>              s = 0xb <Address 0xb out of bounds>, len = 0}, lr = {s =
> 0x7fe8edec64b8 "\002", len = -302977144}, r2 = {s = 0x0, len =
> -302977144}, gr = {s = 0x420960 "", len = 0}, transport_val = {s =
> 0x13 <Address 0x13 out of bounds>,
>              len = -303274192}, ttl_val = {s = 0x7fe8edf0ef88 "\001",
> len = 0}, user_param_val = {s = 0x46c9c2 "", len = 2085992981},
> maddr_val = {s = 0x1 <Address 0x1 out of bounds>, len = 16},
> method_val = {s = 0x7fff7c55bc60 "\001",
>              len = 2085993376}, lr_val = {s = 0x0, len = -88}, r2_val =
> {s = 0x1ef4150 "`\002", len = 8208}, gr_val = {s = 0x1ef6160 "", len =
> -289665440}, u_name = {{s = 0x80 <Address 0x80 out of bounds>, len =
> 8208}, {
>                s = 0x7fe8ee8b7673
> "H\215C\020H\213\\$\bH\213l$\020L\213d$\030L\213l$
> L\213t$(L\213|$0H\203\304\070\303f\017\037D", len = 2085993040}, {s =
> 0x7fe8eebc0e60 "", len = 32457056}, {s = 0x77 <Address 0x77 out of
> bounds>,
>                len = 32457040}, {s = 0x80 <Address 0x80 out of bounds>,
> len = 8208}}, u_val = {{s = 0x7fe8ee8b7c60 "I\211ƃ=\242\311\060", len
> = 0}, {s = 0x1ef3f00 "\270\016\274\356\350\177", len = 2085993264}, {s
> = 0x7fe8eebc0e60 "",
>                len = 0}, {s = 0xffffffff <Address 0xffffffff out of
> bounds>, len = 0}, {s = 0x7fe8eebc0e60 "", len = 21}}, u_params_no =
> 65535}
>          next_hop = {user = {s = 0x0, len = -88}, passwd = {s =
> 0x7fff7c55bb80 "0", len = -292853076}, host = {s = 0x1ef3f00
> "\270\016\274\356\350\177", len = -292479523}, port = {
>              s = 0xffffffffffffffff <Address 0xffffffffffffffff out of
> bounds>, len = 5377792}, params = {s = 0x1700000014 <Address
> 0x1700000014 out of bounds>, len = 14}, headers = {
>              s = 0x7200000000 <Address 0x7200000000 out of bounds>, len
> = 3}, port_no = 0, proto = 0, type = ERROR_URI_T, transport = {s =
> 0x0, len = 30844848}, ttl = {s = 0x7c55bae0 <Address 0x7c55bae0 out of
> bounds>, len = 32},
>            user_param = {s = 0xee98798b <Address 0xee98798b out of
> bounds>, len = 32457068}, maddr = {s = 0x7fe8ee882e3c
> "\200\275\250\372\377\377", len = 5377834}, method = {s = 0x419d73 "",
> len = 2085994264}, lr = {s = 0x0,
>              len = 32457056}, r2 = {s = 0x0, len = 0}, gr = {s = 0x76
> <Address 0x76 out of bounds>, len = 32457056}, transport_val = {s =
> 0x52cd5f58 <Address 0x52cd5f58 out of bounds>, len = -302977144},
> ttl_val = {s = 0x522509 "",
>              len = 1053}, user_param_val = {s = 0x5225be "", len = 1},
> maddr_val = {s = 0x7fe8edec72b8 "\016", len = 5060}, method_val = {s =
> 0x7fe8ee912230 "H\201\304", <incomplete sequence \330>, len = 48},
> lr_val = {
>              s = 0x7fff7c55bc70 "\210\357\360\355\350\177", len =
> 2085993376}, r2_val = {s = 0x454f8c "", len = -302959704}, gr_val = {s
> = 0x7fe8eebc0e64 "\001", len = 1053}, u_name = {{s = 0x7fe8ede41c80
> "SCP1A", len = 5383433}, {
>                s = 0x5225be "", len = 1}, {s = 0x3 <Address 0x3 out of
> bounds>, len = -303274192}, {s = 0x2 <Address 0x2 out of bounds>, len
> = -302977144}, {s = 0x0, len = 5060}}, u_val = {{s = 0x46c6a5 "", len
> = 5060}, {
> ---Type <return> to continue, or q <return> to quit---
>                s = 0x43a1be "", len = 2}, {s = 0x7fe8edec6780 "\001",
> len = 1}, {s = 0x7fe8edf0ef88 "\001", len = 0}, {s = 0x46c761 "", len
> = 5383433}}, u_params_no = 40296}
>          u = <optimized out>
>          port = <optimized out>
>          cmatch = <optimized out>
>          aitem = <optimized out>
>          adefault = <optimized out>
>          spec = <optimized out>
>          model = <optimized out>
>          val = {rs = {s = 0x0, len = 0}, ri = 0, flags = 0}
>          pve = <optimized out>
>          name_s = {s = 0x520f2a "", len = 126}
>          start = {tv_sec = 1389191000, tv_usec = 493112}
>          route_params_bak = <optimized out>
>          route_params_number_bak = <optimized out>
>          __FUNCTION__ = "\000\000\000\000\000\000\000\000\000"
> #4  0x0000000000000000 in ?? ()
> No symbol table info available.
>
>
> Thanks a lot,
>
> Samuel Muller
>
>
> Date: Thu, 19 Dec 2013 12:21:59 -0500
> From: Ovidiu Sas <osas at voipembedded.com>
> Subject: Re: [OpenSIPS-Users] uac_replace_to segmentation fault
> To: OpenSIPS users mailling list <users at lists.opensips.org>
> Message-ID:
>          <CAND0LkvVht8PyjYySQ7Z9nexWpvaxFw1Rr14j9xodiDiroJVdg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Take a look here how to enable core dumps:
> http://www.opensips.org/Documentation/TroubleShooting-Crash
> Even if it's an ARM, you should be able to get a core dump.
>
> Regards,
> Ovidiu Sas
>
> On Thu, Dec 19, 2013 at 12:14 PM, Samuel Muller <sml at l33.fr> wrote:
>> Hello,
>>
>> I discovered that the function "uac_replace_to" does a segmentation fault.
>>
>> Context:
>> Opensips compiled for ARM system.
>> The original request URI makes a fork to several users.
>> When sending to PSTN, I've to rewrite To username because the PSTN
>> gateway uses it instead of R-URI.
>>
>> As I've only 8MB in my system, I can't have anything else than the
>> debugs in stdout ... and no core can be generated :(
>>
>> # config part :
>>
>> branch_route[1] {
>>      if (isflagset(FORK)) {
>>          xlog("L_NOTICE",". branch $T_branch_idx to $ru\r\n");
>>          if (isflagset(TO_PSTN)) {
>>              uac_replace_to("$ru");
>>          }
>>      }
>> }
>>
>>
>> # SIP message :
>>
>> INVITE sip:9 at sip.anywhere.com SIP/2.0
>> v: SIP/2.0/UDP 192.168.1.61:3072;branch=
> z9hG4bK-b44ix110y915;rport
>> f: "Sam" <sip:10933 at sip.anywhere.com>;tag=ydsi0kq193
>> t: <sip:9 at sip.anywhere.com>
>> i: e825b352f45c-vqxs7wotw2g8
>> CSeq: 1 INVITE
>> Max-Forwards: 42
>> m: <sip:10933 at 192.168.1.61:3072>;reg-id=1
>> User-Agent: snom821/8.7.3.19
>> Accept: application/sdp
>> Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE,
>> PRACK, MESSAGE, INFO, UPDATE
>> Allow-Events: talk, hold, refer, call-info
>> Supported: timer, replaces, from-change
>> Session-Expires: 1800;refresher=uas
>> Min-SE: 90
>> c: application/sdp
>> l: 289
>>
>> v=0
>> ...
>> a=sendrecv
>>
>> # opensips debug logs :
>>
>> . branch 0 to sip:0663128505 at sip.anywhere.com
>> [Script Trace][line 340][me][core if] -> (INVITE
>> e825b352f45c-vqxs7wotw2g8 FU=10933 RU=0663128505)
>> [Script Trace][line 337][me][module uac_replace_to] -> (INVITE
>> e825b352f45c-vqxs7wotw2g8 FU=10933 RU=0663128505)
>> Dec 19 17:59:31 [25206] DBG:uac:replace_uri: uri to replace
>> [sip:9 at sip.anywhere.com]
>> Dec 19 17:59:31 [25206] DBG:uac:replace_uri: replacement uri is
>> [sip:0663128505 at sip.anywhere.com]
>> Dec 19 17:59:31 [25206] DBG:uac:replace_uri: encode
>> is=<AAAAAAl2X1FFV1QbRhspCxAbEh9LWE0GD3Jvd3NlLmNvbQ--> len=48
>> Segmentation fault
>>
>>
>> If you know another way to replace $tU ?
>>
>> thanks a lot,
>>
>> Samuel MULLER
>
>
> Samuel MULLER
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list