Okay, I found the problem.  This looks like a sofia-sip bug.  I made a one line 
change to nua_invite_client_ack() function in 
libsofia-sip-ua/nua/nua_session.c, as follows:

OLD: assert(cr->cr_method == sip_method_invite);
NEW: assert((cr->cr_method == sip_method_invite) || (cr->cr_method == 
sip_method_bye));

The OLD line was causing a SIGNAL ( 6:SIGIOT/SIGABRT:IOT trap/Abort) for 
pthread su_root_run in my phone.

Thanks,
Jerry


From: Jerry Richards
Sent: Wednesday, June 22, 2011 9:07 AM
To: 'sofia-sip-devel@lists.sourceforge.net'
Subject: Segmentation Fault After BYE 407 Proxy Authentication

My message below got bounced because of size, so I had to chop off the front 
end of the trace by about 50KB.

From: Jerry Richards
Sent: Wednesday, June 22, 2011 8:50 AM
To: 'sofia-sip-devel@lists.sourceforge.net'
Subject: Segmentation Fault After BYE 407 Proxy Authentication

Hello,

I encountered an su_root_run segmentation fault after a 407 Proxy 
Authentication exchange for a BYE message when interfacing with an Avaya server 
(this is the only server I've ever seen that requires the BYE to be 
authenticated).  The trace is below (I have added logging in my local 
environment).  It looks like the "recv signal r_ack" handling is causing the 
fault.  Do you know why?

Here is the scenario (the trace below is from phone A):
A calls B
B answers
B holds A
B calls C
Let C ring for 30 seconds
B transfers A to the ringing call C
Disconnect A before C answers
******* segmentation fault at A *******

Thanks,
Jerry

----------------------------------------------------------------------------
START OF TRACE
----------------------------------------------------------------------------
No.       Date and Time         Type          Summary
4365  01/06/00-05:02:00.927p     CE2S          nua_bye(nh=0xacb050, 
header=nua_no_refresher)
4366  01/06/00-05:02:00.927p     SOFI          nua: nua_bye: entering
4367  01/06/00-05:02:00.928p     SOFI          nua(0xacb050): sent signal r_bye
4376  01/06/00-05:02:00.971p     SOFI          nua(0xacb050): recv signal r_bye
4377  01/06/00-05:02:00.971p     SOFI          nua: nua_stack_set_params: 
entering
4378  01/06/00-05:02:00.973p     SOFI          auth_digest_a1() has A1 = 
MD5(5385079:avaya.com:885333) = a0670cb878f0ef45347022857dbfee0e
4379  01/06/00-05:02:00.973p     SOFI          A2 = 
MD5(BYE:sip:5385080@205.168.62.39:5080;transport=tcp)
4380  01/06/00-05:02:00.974p     SOFI          auth_response: 
305fd2da85dc8b2c68598cfac7c3379a = 
MD5(a0670cb878f0ef45347022857dbfee0e:130b7fe59ce1556fcebd0b40218d91bd81244b4b215:00000003:p1ONJj79EiKyHo+TSefHNA:auth:7ddec71f6886531fa769bb5f172cc111)
 (qop=auth)
4381  01/06/00-05:02:00.975p     SOFI             [2]outgoing_create()
4382  01/06/00-05:02:00.975p     SOFI          outgoing_create: 
[1]route_url->us_url->url_host=205.168.62.117
4383  01/06/00-05:02:00.975p     SOFI          outgoing_create: 
[2]route_url->us_url->url_host=205.168.62.117
4384  01/06/00-05:02:00.975p     SOFI          outgoing_create: 
[3]route_url->us_url->url_host=205.168.62.117
4385  01/06/00-05:02:00.975p     SOFI          outgoing_create: 
[4]route_url->us_url->url_host=205.168.62.117
4386  01/06/00-05:02:00.976p     SOFI          outgoing_create: 
[5]route_url->us_url->url_host=205.168.62.117
4387  01/06/00-05:02:00.976p     SOFI          nta: selecting scheme sip
4388  01/06/00-05:02:00.976p     SOFI             url->url_host=205.168.62.117
4389  01/06/00-05:02:00.977p     SOFI             
us->us_url->url_host=205.168.62.117
4390  01/06/00-05:02:00.977p     SOFI          tport(0xac3508): found 0xac7b40 
by name */205.168.62.117:5060
4391  01/06/00-05:02:00.978p     SOFI          tport_tsend(0xac7b40) tpn = 
*/205.168.62.117:5060
4392  01/06/00-05:02:00.979p     SIP_          [SND REQ] BYE 
sip:5385080@205.168.62.39:5080;transport=tcp (to 205.168.62.117:5060), CSEQ: 
101688416 BYE
4393  01/06/00-05:02:00.980p     SOFI          tport_vsend(0xac7b40): 1212 
bytes of 1212 to tcp/205.168.62.117:5060
4394  01/06/00-05:02:00.980p     SOFI          tport_vsend returned 1212
4395  01/06/00-05:02:00.980p     SOFI          tport(0xac7b40): reset timer
4396  01/06/00-05:02:00.980p     SOFI          nta: sent BYE (101688416) to 
*/205.168.62.117:5060
4397  01/06/00-05:02:00.981p     SOFI          tport_pend(0xac7b40): pending 
0xacc390 for tcp/205.168.62.117:5060 (already 1)
4398  01/06/00-05:02:00.981p     SOFI          nta: timer set to 32000 ms
4399  01/06/00-05:02:01.048p     SOFI          tport_wakeup(0xac7b40): events IN
4400  01/06/00-05:02:01.048p     SOFI          tport_recv_event(0xac7b40)
4401  01/06/00-05:02:01.049p     SOFI          tport_recv_iovec(0xac7b40) msg 
0xaca3c8 from (tcp/205.168.62.117:5060) has 523 bytes, veclen = 1
4402  01/06/00-05:02:01.049p     SIP_          [RCV STA] 407 Proxy 
Authentication Required (from 205.168.62.117:5060), CSEQ: 101688416 BYE
4403  01/06/00-05:02:01.051p     SOFI          tport_deliver(0xac7b40): msg 
0xaca3c8 (523 bytes) from tcp/205.168.62.117:5060/sip next=(nil)
4404  01/06/00-05:02:01.051p     SOFI          nta: received 407 Proxy 
Authentication Required for BYE (101688416)
4405  01/06/00-05:02:01.051p     SOFI          nta: 407 Proxy Authentication 
Required is going to a transaction
4406  01/06/00-05:02:01.052p     SOFI          nta_outgoing: RTT is 73.97 ms
4407  01/06/00-05:02:01.052p     SOFI          tport_release(0xac7b40): 
0xacc390 by 0xacbd70 with 0xaca3c8
4408  01/06/00-05:02:01.052p     SOFI          auth_digest_challenge_get(): got 
8
4409  01/06/00-05:02:01.054p     SOFI          auth_digest_a1() has A1 = 
MD5(5385079:avaya.com:885333) = a0670cb878f0ef45347022857dbfee0e
4410  01/06/00-05:02:01.054p     SOFI          A2 = 
MD5(BYE:sip:5385080@205.168.62.39:5080;transport=tcp)
4411  01/06/00-05:02:01.055p     SOFI          auth_response: 
a3815e43cdbd7aa15e0fe0326cd2d51a = 
MD5(a0670cb878f0ef45347022857dbfee0e:130b7ff87978b0b1640b98e8c30ea6b4f61ccc4f33e:00000001:1VEd4T79EiKyHo+TSefHNA:auth:7ddec71f6886531fa769bb5f172cc111)
 (qop=auth)
4412  01/06/00-05:02:01.056p     SOFI             [2]outgoing_create()
4413  01/06/00-05:02:01.057p     SOFI          outgoing_create: 
[1]route_url->us_url->url_host=205.168.62.117
4414  01/06/00-05:02:01.057p     SOFI          outgoing_create: 
[2]route_url->us_url->url_host=205.168.62.117
4415  01/06/00-05:02:01.057p     SOFI          outgoing_create: 
[3]route_url->us_url->url_host=205.168.62.117
4416  01/06/00-05:02:01.057p     SOFI          outgoing_create: 
[4]route_url->us_url->url_host=205.168.62.117
4417  01/06/00-05:02:01.057p     SOFI          outgoing_create: 
[5]route_url->us_url->url_host=205.168.62.117
4418  01/06/00-05:02:01.057p     SOFI          nta: selecting scheme sip
4419  01/06/00-05:02:01.057p     SOFI             url->url_host=205.168.62.117
4420  01/06/00-05:02:01.058p     SOFI             
us->us_url->url_host=205.168.62.117
4421  01/06/00-05:02:01.058p     SOFI          tport(0xac3508): found 0xac7b40 
by name */205.168.62.117:5060
4422  01/06/00-05:02:01.059p     SOFI          tport_tsend(0xac7b40) tpn = 
*/205.168.62.117:5060
4423  01/06/00-05:02:01.060p     SIP_          [SND REQ] BYE 
sip:5385080@205.168.62.39:5080;transport=tcp (to 205.168.62.117:5060), CSEQ: 
101688417 BYE
4424  01/06/00-05:02:01.061p     SOFI          tport_vsend(0xac7b40): 1212 
bytes of 1212 to tcp/205.168.62.117:5060
4425  01/06/00-05:02:01.061p     SOFI          tport_vsend returned 1212
4426  01/06/00-05:02:01.061p     SOFI          tport(0xac7b40): reset timer
4427  01/06/00-05:02:01.062p     SOFI          nta: sent BYE (101688417) to 
*/205.168.62.117:5060
4428  01/06/00-05:02:01.062p     SOFI          tport_pend(0xac7b40): pending 
0xacecb8 for tcp/205.168.62.117:5060 (already 1)
4429  01/06/00-05:02:01.062p     SOFI          nua(0xacb050): event r_bye 100 
Request Authorized by Cache
4430  01/06/00-05:02:01.063p     SOFI          nua: nua_application_event: 
entering
4444  01/06/00-05:02:01.067p     CE2S          [2]nua_ack(nh=0xacb050, 
SIPTAG_FROM_STR(5385079 <sip:5385...@avaya.com:5060>))
4445  01/06/00-05:02:01.067p     SOFI          nua: nua_ack: entering
4446  01/06/00-05:02:01.067p     SOFI          nua(0xacb050): sent signal r_ack
4451  01/06/00-05:02:01.068p     CE2S          nua_handle_destroy(nh=0xacb050)
4452  01/06/00-05:02:01.068p     SOFI          nua: nua_handle_destroy: entering
4453  01/06/00-05:02:01.068p     SOFI          nua(0xacb050): sent signal 
r_destroy
4464  01/06/00-05:02:01.100p     SOFI          nta: outgoing_free(0xacbd70)
4465  01/06/00-05:02:01.101p     SOFI          tport(0xac7b40): reset timer
4466  01/06/00-05:02:01.101p     SOFI          nua(0xacb050): recv signal r_ack
4467  01/06/00-05:02:01.101p     SOFI          nua: nua_stack_set_params: 
entering
4468  01/06/00-05:02:01.102p     FLSH          @COMMON #916:SIGNAL ( 
6:SIGIOT/SIGABRT:IOT trap/Abort)
4469        01/06/00-05:02:01.102p  FLSH       @COMMON 
#933:su_root_run=127/0x4411, addr=0x0000007f
----------------------------------------------------------------------------
END OF TRACE
----------------------------------------------------------------------------

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to