mydecember / doubango-1

Automatically exported from code.google.com/p/doubango
0 stars 0 forks source link

Deadlock on simultaneous hangup from both part (remote and local). #141

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Initial state: Audio Video call in active state (Problem only happens with 
video call)
2. Hangup at same time from both part
3. Deadlock of the application.

What version of the product are you using? On what operating system?
Doubango r725
Operating system IOS 5 (IPad system), internal client (OpenTouch)

Same behaviour with Idoubs

Please provide any additional information below.

Deadlock happens between threads:

- Thread X is processing BYE received from network (tsip_dialog_invite.c: 
TSIP_REQUEST_IS_BYE). It perform fsm_act method, lock mutex (self) and continue 
to process stop operation on tdav_video_jb_stop. It wait from pthread_join 
operation to finish (it stay infinitely block ????)

- Second thread Y is processing hangup request coming from application. It 
perform a tsip_dialog_hangup, then stay block on tsip_dialog_t mutex already 
used by previous thread.

To fix the problem, I avoid treatment of the second terminating event. On first 
terminating event, I change tsip_dialog_t->state to tsip_terminating state 
(perhaps there is no need to create new enum value but only used 
tsip_terminated one), then I test state to avoid fsm_act treatment on second 
one.

Perhaps, you will have another (or better) fix to propose.

Best regards,

Eric.

Original issue reported on code.google.com by bramoull...@gmail.com on 3 Oct 2012 at 12:18