Ticket #2005 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Crash when hanging up call if video capture device fails to open

Reported by: ming Owned by: bennylp
Priority: normal Milestone: release-2.7
Component: pjsua-lib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

If video capture device fails to open, with the log, such as:

10:06:23.470          pjsua_media.c  .......pjsua_vid_channel_update() failed for call_id 0 media 1: Invalid video device (PJMEDIA_EVID_INVDEV)
10:06:23.470          pjsua_media.c  .......Error updating media call00:1: Invalid video device (PJMEDIA_EVID_INVDEV)

Later, when hanging up the call, pjsip will crash:

* thread #11: tid = 0x15b187, 0x00000001001d3c5c pjsua-x86_64-apple-darwin16.4.0`pjmedia_transport_send_rtcp(tp=0x0000000105014428, pkt=0x00000001020757f0, size=72) + 28 at transport.h:792, stop reason = EXC_BAD_ACCESS (code=1, address=0x20)
  * frame #0: 0x00000001001d3c5c pjsua-x86_64-apple-darwin16.4.0`pjmedia_transport_send_rtcp(tp=0x0000000105014428, pkt=0x00000001020757f0, size=72) + 28 at transport.h:792
    frame #1: 0x00000001001d1acf pjsua-x86_64-apple-darwin16.4.0`send_rtcp(stream=0x0000000102817e28, with_sdes=1, with_bye=1) + 527 at vid_stream.c:533
    frame #2: 0x00000001001d26de pjsua-x86_64-apple-darwin16.4.0`pjmedia_vid_stream_send_rtcp_bye(stream=0x0000000102817e28) + 158 at vid_stream.c:2031
    frame #3: 0x000000010010e85f pjsua-x86_64-apple-darwin16.4.0`pjsua_vid_stop_stream(call_med=0x00000001005481a0) + 207 at pjsua_vid.c:1146

The crash is caused because when pjsua_vid_channel_update() fails, it will stop the media stream and close media transport. However, stop_media_stram() is essentially no-op for new provisional medias. Thus, later, during hangup, when stop_media_stream() is called again to destroy the media, it will cause crash since media transport has been closed.

Change History

comment:1 Changed 7 months ago by ming

  • Status changed from new to closed
  • Resolution set to fixed

In 5571:

Fixed #2005: Crash when hanging up call if video capture device fails to open

Note: See TracTickets for help on using tickets.