[Live-devel] Access violation crash in rtspclient

Jeff Shanab jshanab at smartwire.com
Sat Nov 19 13:34:29 PST 2011



From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Saturday, November 19, 2011 2:51 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Access violation crash in rtspclient

2 adjustments to the library allow me to tiptoe thru the call stack avoiding accessing destroyed or already deleted members and unwind this stack.

I'll be doing something similar to your first fix (but it most certainly will not be using a "goto" :-)

Yeah it was a "hack"  I looked at the code and it seems we may need to de-couple destruction from stopping, maybe a flag. Let the objects natural destruction occur when the last thing exits.


This gest me almost all the way out of the stack unwind. But when I return to RTSPClient::playMediaSession after the call to the event loop there is a "delete[] fResultString"

OK, that's your fault.  You're using the synchronous "RTSPClient" interface - which is OK - but you're having your "BYE" handler callback routine delete your "RTSPClient" object while you're in the middle of a synchronous operation.  That's bad (on your part).  (It's weird that you're getting a RTCP "BYE" before you get a response to your RTSP "PLAY" command, but I suppose that's possible...)

What can I say, legacy code. Gotta refactor when there is time. This was discovered a week before a deployment. Here is how I get the BYE request.
The hardware is a 4 channel h264 encoder that takes analog camera inputs. This encoder has what I consider to be a great feature over the other encoder we have. If there is no video input, instead of compressing a fancy frame that says "no video" over and over again, wasting disk space, It times out after 30 seconds and sends the BYE Request.  It goes thru the entire conversation up to that point. It probably should respond negatively to the PLAY request. If that would fit the standard better, I can have the firmware adjusted (but we need to handle these rouge servers robustly at least)

It was just when I unplugged a video camera's power supply by accident that the client on my end crashed. Mild panic ensued and almost ruined my whole weekend. :)

What you'll need to do, then, is have your "BYE" handler routine set a Boolean flag (but not actually delete anything then), and have your code test for this flag after it returns from "playMediaSession()".

Just curious, When/if is that next release scheduled?
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111119/7f3635f0/attachment.html>


More information about the live-devel mailing list