<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-style-span
{mso-style-name:apple-style-span;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>When trying to get to the bottom of this "TEARDOWN exception" I started by testing different streams. Some noteworthy observations:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- The frequency of the exceptions varies greatly. Sometimes I can get one exception every 10min, while other times I can run multiple clients for a few days before seeing one.<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- The exception occurs on all computers I've tested it on, although I've only been running Windows clients.<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- The exception has occurred both for live streams and archive, i.e. non-live, streams. It also occurs for different cameras and isn't limited to a specific stream. I've confirmed that the exception happens when streaming from both Cisco VSM 6 and VSM 7.<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- I've however not seen the exception while streaming from an Axis 243q encoder. Since the crashes are so random, you can't draw any confident conclusions, but I've had multiple clients streaming from 3 Axis encoders for multiple days, so everything points towards that the exceptions don't occur with the Axis encoders. I.e. the exception has (so far) only occurred using Cisco VSM.</span></i><span style='font-family:"Courier New";color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>I then started adding debug printouts to the code. After a while I noticed it always happens in DummySink::afterGettingFrame(), although that makes no sense. In the testRTSPClient example that function only calls continuePlaying(). The debug message (602) right before the call to continuePlaying() is always printed when the exception occurs, but not any message in continuePlaying().<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>The crashes are very consistent. Not the frequency, but the location. When they occur, 602 is always the last message printed. I've attached an output example. Judging by the callstack it almost looks to me like the printf would be the cause, but the same thing happens if I remove the debug output, i.e. 602, and 601 etc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>This however makes no sense at all. What is causing the sudden app crash? I see no explanation at all in the code. As can be seen, I added a try-catch, but that didn't do anything.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>With strange errors like this I would almost suspect some odd linking problem or strange Windows-issue, but that would not explain why it works most of the time, and why it never tends to crash with some streams (i.e. when not streaming via Cisco VSM). I would also suspect threads going havoc, but as liveMedia is single-threaded that shouldn't be the case.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>It definitely seems like the server matters. How can that be?<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-family:"Courier New";color:black'>Any ideas at all what might be going on? </span></b><b><span style='font-family:"Calibri","sans-serif";color:black'><o:p></o:p></span></b></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'>Included files in the attached zip-archive:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- testRTSPClient.cpp: Modified example that takes 2 arguments; two rtsp url's to cycle between. The dwell time, i.e the number of seconds to wait between switching streams is set to 5s. E.g.:<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>testRTSPClient.exe rtsp://192.168.1.103/archive/TVF-04Ba rtsp://192.168.1.103/archive/TVF-16a<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- Output.txt: Typical example of program output; always crashes after debug message 602. Note that the output shows some additional "debug numbers" that I added to the library while hunting this down.<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span style='font-family:"Courier New";color:black'>- Callstack.png: Snapshot example of the callstack while running the debug version within Visual Studio.</span></i><span style='font-family:"Courier New";color:black'><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:black'>/Claes<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> live-devel-bounces@ns.live555.com [mailto:live-devel-bounces@ns.live555.com] <b>On Behalf Of </b>Ross Finlayson<br><b>Sent:</b> Thursday, January 10, 2013 6:43 PM<br><b>To:</b> LIVE555 Streaming Media - development & use<br><b>Subject:</b> Re: [Live-devel] Unhandled exception during TEARDOWN<o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>I ran your modified application for several hours (on FreeBSD, under GDB), and also on Linux using "valgrind", but unfortunately was unable to find any problem.<o:p></o:p></p><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-left:.5in'>I suspect that whatever bug is causing this is something that (for some reason) is causing an exception only in your environment. I'm still interested in learning the cause, of course (especially if it is - as it appears to be - a bug in our code), but it looks like you're probably going to have to track this down yourself.<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal style='margin-left:.5in'><span class=apple-style-span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'>Ross Finlayson</span></span><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'><br><span class=apple-style-span>Live Networks, Inc.</span><br><span class=apple-style-span><a href="http://www.live555.com/">http://www.live555.com/</a></span></span> <o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>