<div dir="ltr">I'm using LCR as a GSM <-> SIP interface and I've been trying to figure out why MO calls result in a segfault. I am running openbsc on cdc548cb and LCR on  c14326641a built and run on an ubuntu 14.04 64bit.<div><br></div><div>From what I've investigated so far, the request_uri passed to sofia-sip is malformed.<br><div><br></div><div>Has anyone seen this problem before? Would appreciate pointers.</div><div><br>Here are the full logs and stack trace:<div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote>** LCR  Version 1.14<br>000000 DEBUG (in route.c/getrulesetbyname() line 1928): ruleset main found.<br>000000 DEBUG (in sip.cpp/sip_init() line 1997): SIP globals initialized<br>000000 DEBUG (in gsm.cpp/mncc_socket_retry_cb() line 1443): Connected to MNCC socket /tmp/bsc_mncc!<br>su_port_create(0x6ad410): epoll_create() => 0: OK<br>su_socket_port_init(0x6ad410, 0x7ffff7dcf880) called<br>su_pthread_port_init(0x6ad410, 0x7ffff7dcf880) called<br>nua: nua_create: entering<br>[New Thread 0x7ffff6c52700 (LWP 11520)]<br>su_port_create(0x7ffff00008c0): epoll_create() => 0: OK<br>su_socket_port_init(0x7ffff00008c0, 0x7ffff7dcf880) called<br>su_pthread_port_init(0x7ffff00008c0, 0x7ffff7dcf880) called<br>nua: nua_stack_init: entering<br>nua: nua_stack_set_params: entering<br>soa_create("default", 0x7ffff0001130, 0x7ffff0001230) called<br>soa_set_params(static::0x7ffff0001920, ...) called<br>soa_set_params(static::0x7ffff0001920, ...) called<br>nta_agent_create: initialized hash tables<br>nta_agent_create: initialized transports<br>nta_agent_create: initialized random identifiers<br>nta_agent_create: initialized timer<br>nta_agent_create: initialized resolver<br>tport_create(): 0x7ffff0003df0<br>nta: master transport created<br>tport_bind_server(0x7ffff0003df0) to */<a href="http://127.0.0.1:5062/sip">127.0.0.1:5062/sip</a><br>tport_bind_server(0x7ffff0003df0): calling tport_listen for udp<br>tport_alloc_primary(0x7ffff0003df0): new primary tport 0x7ffff0004470<br>tport_listen(0x7ffff0004470): listening at udp/<a href="http://127.0.0.1:5062/sip">127.0.0.1:5062/sip</a><br>tport_bind_server(0x7ffff0003df0): calling tport_listen for tcp<br>tport_alloc_primary(0x7ffff0003df0): new primary tport 0x7ffff0004910<br>tport_listen(0x7ffff0004910): listening at tcp/<a href="http://127.0.0.1:5062/sip">127.0.0.1:5062/sip</a><br>nta: bound to (127.0.0.1:5062;transport=*)<br>nta: agent_init_via: SIP/2.0/udp <a href="http://127.0.0.1:5062">127.0.0.1:5062</a> (sip)<br>nta: agent_init_via: SIP/2.0/tcp <a href="http://127.0.0.1:5062">127.0.0.1:5062</a> (sip)<br>nta: Via fields initialized<br>nta: Contact header created<br>nua_register: Adding contact URL '127.0.0.1' to list.<br>nua: nua_set_params: entering<br>nua((nil)): sent signal r_set_params<br>000000 DEBUG (in sip.cpp/sip_init_inst() line 1942): SIP interface created (inst=0x6acce0)<br>nua((nil)): recv signal r_set_params<br>nua: nua_stack_set_params: entering<br>soa_set_params(static::0x7ffff0001920, ...) called<br>nua((nil)): event r_set_params 200 OK<br>LCR 1.14 started, waiting for calls...<br>000000 TRACE 15.01.16 11:36:21.011 --: LCR 1.14 started, waiting for calls...<br>nua: nua_application_event: entering<br>000000 DEBUG (in sip.cpp/sip_callback() line 1785): Event 23 from stack received (handle=(nil))<br>000000 DEBUG (in port.cpp/Port() line 210): new port (1) of type 0x3101, name 'gsm-0-in' interface 'gsm'<br>000000 DEBUG (in gsm.cpp/Pgsm() line 239): Created new GSMPort(gsm-0-in).<br>000000 DEBUG (in gsm_bs.cpp/Pgsm_bs() line 56): Created new GSMBSPort(gsm-0-in).<br>000000 TRACE 15.01.16 11:37:28.210 CH(1): New call ref LCR<->BSC  callref new=0x8000000d<br>000000 TRACE 15.01.16 11:37:28.210 CH(1): Codec negotiation LCR<->BSC  bearer capa='given by MS'  speech version='Full Rate given'<br>000000 TRACE 15.01.16 11:37:28.210 CH(1): MNCC_SETUP_IND LCR<->BSC  calling number=639360100037 imsi=901550000000824  dialing number=12345678<br>000000 DEBUG (in endpoint.cpp/Endpoint() line 48): EPOINT(1): Allocating enpoint 1 and connecting it with: ioport<br>000000 DEBUG (in endpoint.cpp/portlist_new() line 150): EPOINT(1) allocating port_list, attaching to port 1<br>000000 DEBUG (in appbridge.cpp/EndpointAppBridge() line 31): Bridge endpoint created<br>000000 DEBUG (in port.cpp/epointlist_new() line 131): PORT(1) allocating epoint_list.<br>000000 TRACE 15.01.16 11:37:28.211 CH(1): MNCC_CALL_PROC_REQ LCR<->BSC  progress coding=3 location=1 descr=8<br>000000 DEBUG (in port.cpp/new_state() line 283): PORT(gsm-0-in) new state PORT_STATE_IDLE --> PORT_STATE_IN_PROCEEDING<br>000000 TRACE 15.01.16 11:37:28.211 CH(1): MNCC_FRAME_RECV LCR<->BSC<br>000000 DEBUG (in gsm_bs.cpp/setup_ind() line 631): Request RTP peer info, before forwarding setup<br>000000 DEBUG (in gsm.cpp/rtp_create_ind() line 869): Got RTP peer info (7f000001,52103) forwarding setup<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_SETUP written from 140733193388033 to 140733193388033 (memory 6b1a50 at file gsm.cpp, line 872)<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_SETUP reading from 1 to 140733193388033 (memory 6b1a50)<br>000000 DEBUG (in appbridge.cpp/port_setup() line 94): EPOINT(1) epoint received setup from='639360100037' to='12345678'<br>000000 DEBUG (in port.cpp/Port() line 210): new port (2) of type 0x2002, name 'sip-0-out' interface 'sip'<br>000000 DEBUG (in sip.cpp/Psip() line 72): Created new Psip(sip-0-out).<br>000000 DEBUG (in endpoint.cpp/portlist_new() line 150): EPOINT(1) allocating port_list, attaching to port 2<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_SETUP written from 1 to 2 (memory 6b1a50 at file message.c, line 94)<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_BRIDGE written from 1 to 1 (memory 6b6c00 at file appbridge.cpp, line 222)<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_BRIDGE written from 1 to 2 (memory 6ba6e0 at file appbridge.cpp, line 225)<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_SETUP reading from 140733193388033 to 2 (memory 6b1a50)<br>000000 DEBUG (in sip.cpp/message_setup() line 954): Doing Setup (inst 0x6acce0)<br>000000 DEBUG (in sip.cpp/message_setup() line 961): RTP info given by remote, forward that<br>000000 DEBUG (in sip.cpp/message_setup() line 968): local ip 7f000001 port 52103<br>000000 DEBUG (in sip.cpp/message_setup() line 969): remote ip 00000000 port 0<br>nua: nh_create_handle: entering<br>000000 TRACE 15.01.16 11:37:28.816 CH(2): NEW handle  handle new=0x6b09c0<br>000000 DEBUG (in sip.cpp/message_setup() line 1038): Using SDP for invite: v=0<br>o=LCR-Sofia-SIP 0 0 IN IP4 127.0.0.1<br>s=SIP Call<br>c=IN IP4 127.0.0.1<br>t=0 0<br>m=audio 52103 RTP/AVP 3<br>a=rtpmap:3 GSM/8000<br>000000 TRACE 15.01.16 11:37:28.816 CH(2): INVITE  from uri=<a href="http://sip:639360100037@127.0.0.1:5062">sip:639360100037@127.0.0.1:5062</a>  to uri=<a href="http://sip:12345678@192.168.40.100:5060">sip:12345678@192.168.40.100:5060</a>  rtp ip=127.0.0.1 port=52103,52104 payload=GSM:3<br>nua: nua_invite: entering<br>nua(0x6b09c0): sent signal r_invite<br>000000 DEBUG (in port.cpp/new_state() line 283): PORT(sip-0-out) new state PORT_STATE_IDLE --> PORT_STATE_OUT_SETUP<br>000000 DEBUG (in sip.cpp/message_setup() line 1069): do proceeding<br>000000 DEBUG (in port.cpp/new_state() line 283): PORT(sip-0-out) new state PORT_STATE_OUT_SETUP --> PORT_STATE_OUT_PROCEEDING<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_PROCEEDING written from 2 to 1 (memory 6be1c0 at file sip.cpp, line 1072)<br>000000 DEBUG (in port.cpp/epointlist_new() line 131): PORT(2) allocating epoint_list.<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_BRIDGE reading from 1 to 1 (memory 6b6c00)<br>000000 DEBUG (in port.cpp/message_epoint() line 657): PORT(gsm-0-in) bridging to id 1<br>nua(0x6b09c0): recv signal r_invite<br>000000 DEBUG (in port.cpp/bridge() line 1305): Port 1 creating not existing bridge 1.<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_BRIDGE reading from 1 to 2 (memory 6ba6e0)<br>000000 DEBUG (in port.cpp/message_epoint() line 657): PORT(sip-0-out) bridging to id 1<br>nua: nua_stack_set_params: entering<br>000000 DEBUG (in port.cpp/bridge() line 1290): Port 2 found existing bridge 1.<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_PROCEEDING reading from 2 to 1 (memory 6be1c0)<br>000000 DEBUG (in appbridge.cpp/port_other() line 259): EPOINT(8) epoint received message 7070144 from port<br>000000 DEBUG (in message.c/_message_put() line 70): message MESSAGE_PROCEEDING written from 1 to 140733193388033 (memory 6be1c0 at file message.c, line 94)<br>000000 DEBUG (in message.c/message_get() line 115): message MESSAGE_PROCEEDING reading from 1 to 1 (memory 6be1c0)<br>nua(0x6b09c0): adding session usage<br>nta_leg_tcreate(0x7ffff0006b00)<br>Program received signal SIGSEGV, Segmentation fault.<br>[Switching to Thread 0x7ffff6c52700 (LWP 11520)]<br>strlen () at ../sysdeps/x86_64/strlen.S:106<br>106 ../sysdeps/x86_64/strlen.S: No such file or directory.<br>(gdb) bt<br>#0  strlen () at ../sysdeps/x86_64/strlen.S:106<br>#1  0x00007ffff7b70896 in url_xtra (url=url@entry=0x7ffff00075d0) at url.c:1048<br>#2  0x00007ffff7b2deaf in sip_request_create (home=home@entry=0x7ffff0006fc0, method=method@entry=sip_method_invite, name=0x7ffff7b916e2 <sip_method_name_invite> "INVITE",<br>    name@entry=0x7ffff7b8ed49 "INVITE", uri=uri@entry=0x7ffff00075d0, version=version@entry=0x0) at sip_basic.c:225<br>#3  0x00007ffff7ae3512 in nta_msg_request_complete (msg=msg@entry=0x7ffff0006fc0, leg=leg@entry=0x7ffff0006b00, method=method@entry=sip_method_invite,<br>    method_name=method_name@entry=0x7ffff7b8ed49 "INVITE", request_uri=0x7ffff00075d0, request_uri@entry=0x0) at nta.c:3890<br>#4  0x00007ffff7b07d92 in nua_client_request_sendmsg (cr=cr@entry=0x7ffff0005af0) at nua_client.c:803<br>#5  0x00007ffff7b08de9 in nua_client_request_try (cr=0x7ffff0005af0) at nua_client.c:708<br>#6  0x00007ffff7b06b93 in nua_client_init_request0 (cr=0x7ffff0005af0) at nua_client.c:605<br>#7  nua_client_init_request (cr=0x7ffff0005af0) at nua_client.c:442<br>#8  0x00007ffff7b07246 in nua_client_create (nh=nh@entry=0x6b09c0, event=event@entry=31, methods=methods@entry=0x7ffff7dc4d20 <nua_invite_client_methods>, tags=tags@entry=0x6b0eb0)<br>    at nua_client.c:199<br>#9  0x00007ffff7b1cc61 in nua_stack_invite (nua=nua@entry=0x6adc80, nh=nh@entry=0x6b09c0, e=e@entry=nua_r_invite, tags=tags@entry=0x6b0eb0) at nua_session.c:705<br>#10 0x00007ffff7b03eb3 in nua_stack_signal (nua=0x6adc80, msg=<optimized out>, ee=0x6b0e88) at nua_stack.c:582<br>#11 0x00007ffff7b522b2 in su_base_port_execute_msgs (queue=0x0) at su_base_port.c:280<br>#12 0x00007ffff7b527bd in su_base_port_run (self=0x7ffff00008c0) at su_base_port.c:335<br>#13 0x00007ffff7b52f10 in su_pthread_port_clone_main (varg=0x7fffffffe4c0) at su_pthread_port.c:324<br>#14 0x00007ffff7840182 in start_thread (arg=0x7ffff6c52700) at pthread_create.c:312<br>#15 0x00007ffff6d4d47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111</blockquote></blockquote></div></div></div></div>