Bug 14523 - Touch freezeing and rebooting when playing Rhapsody
: Touch freezeing and rebooting when playing Rhapsody
Status: CLOSED FIXED
Product: SB Touch
Classification: Unclassified
Component: Audio
: unspecified
: PC Windows Vista
: P1 normal (vote)
: 7.5.0
Assigned To: Alan Young
http://forums.slimdevices.com/showpos...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-02 08:59 UTC by Michael Valera
Modified: 2010-04-08 17:24 UTC (History)
4 users (show)

See Also:
Category: Task


Attachments
serial capture (160.73 KB, text/plain)
2009-10-02 09:51 UTC, James Richardson
Details
serial log (475.87 KB, application/octet-stream)
2009-11-13 09:00 UTC, James Richardson
Details
Log from Mike (140.77 KB, text/plain)
2009-12-18 10:58 UTC, Michael Valera
Details
Proposed patch (882 bytes, patch)
2010-03-08 04:09 UTC, Alan Young
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valera 2009-10-02 08:59:37 UTC
Playing any Rhapsody song in my library results in the following behavior:

*Plays first 3-5 second of the song
*Skips to next song
*Touch freezes within 3 seconds
*Touch reboots

Repeated behavior with touch directed to my ScqueezeCenter or SqueezeNetwork.

SC Version: 7.4.0 - r28660
Touch Firmware: 7.4.0-r7790

Mike
Comment 1 Michael Valera 2009-10-02 09:07:24 UTC
attached web forum posting URL
Comment 2 James Richardson 2009-10-02 09:21:40 UTC
Michael: can you provide some logs
Comment 3 Richard Titmuss 2009-10-02 09:28:25 UTC
Mike, it works fine here. What's your mac address?
Comment 4 James Richardson 2009-10-02 09:51:24 UTC
Created attachment 5986 [details]
serial capture
Comment 5 Michael Valera 2009-10-02 10:02:37 UTC
Mac Address:
00:04:20:22:00:37

I assume the file James attached is my log. If not how do I grab that?

Mike
Comment 6 Richard Titmuss 2009-10-20 04:45:51 UTC
James, I don't see anything in the log. Does that mean you can reproduce this? I really need a reproducible case, but it works fine here.

Mike, what tracks do you see this with (maybe it's only some Rhapsody tracks with this problem, and not the ones I test with).
Comment 7 Michael Valera 2009-10-20 09:04:17 UTC
It happens with anything I play on Rhapsody...

How do I capture a log? Is there a Wiki article someone can point me too?

If anyone wants to call me @ 510-657-8747 x236 they can walk me thru it.

Mike
Comment 8 James Richardson 2009-10-29 14:45:07 UTC
Oct 29 14:39:50 squeezeplay: playback_callback:332 Audio underrun: used 400 fram
es, requested 441 frames. elapsed samples 10165872
Oct 29 14:40:24 squeezeplay: WARN   net.thread - NetworkThread.lua:146 network t
hread timeout for Task(SocketHttp {mysqueezebox.com_Request}(R))


I see that in the log, when the error happens.

Its easy to repo here

Start a Fab4
Attach to SqueezeNetwork (test.sn)
Go to Rhapsody
Start playing any content.  I did Music Guide > Genres > Folk> Genre Sampler  <press and hold // play>
Let it play till the error happens.  Typically between 3-15 tracks will cause it to happen.

Tested with 7.5.0 r7965, Serial attached to monitor, tail -f /var/log/messages
Comment 9 SVN Bot 2009-11-02 11:43:07 UTC
 == Auto-comment from SVN commit #7991 to the jive repo by richard ==
 == https://svn.slimdevices.com/jive?view=revision&revision=7991 ==

Fixed Bug #14523
While booting wait for mmc/sd cards or usb drives to be mounted before continuing. This allows the debug logging to work correctly.

Mount removable volumes without sync, otherwise it's too slow.
Comment 10 Richard Titmuss 2009-11-02 11:43:53 UTC
Opps, wrong bug number in check in comment.
Comment 11 SVN Bot 2009-11-04 09:12:02 UTC
 == Auto-comment from SVN commit #8009 to the jive repo by richard ==
 == https://svn.slimdevices.com/jive?view=revision&revision=8009 ==

Bug #14523
Added debug to get full headers when playing remote streams.
Comment 12 SVN Bot 2009-11-04 09:26:47 UTC
 == Auto-comment from SVN commit #8010 to the jive repo by richard ==
 == https://svn.slimdevices.com/jive?view=revision&revision=8010 ==

Bug #14523
Fix (rare) memory error found with valgrind.
Comment 13 SVN Bot 2009-11-04 12:07:55 UTC
 == Auto-comment from SVN commit #6544 to the player repo by richard ==
 == https://svn.slimdevices.com/player?view=revision&revision=6544 ==

Bug #14523
Possible fixes for rhapsody crashes.
Comment 14 SVN Bot 2009-11-04 12:10:03 UTC
 == Auto-comment from SVN commit #8013 to the jive repo by richard ==
 == https://svn.slimdevices.com/jive?view=revision&revision=8013 ==

Bug #14523
Kick build server.
Comment 15 SVN Bot 2009-11-04 14:38:45 UTC
 == Auto-comment from SVN commit #6545 to the player repo by richard ==
 == https://svn.slimdevices.com/player?view=revision&revision=6545 ==

Bug #14523
Fix compile error on arm.
Comment 16 Richard Titmuss 2009-11-05 01:17:14 UTC
QA to retest after yesterdays changes.

Mike, could you also try r8013 or later. Thanks.
Comment 17 SVN Bot 2009-11-11 02:40:19 UTC
 == Auto-comment from SVN commit #6570 to the player repo by richard ==
 == https://svn.slimdevices.com/player?view=revision&revision=6570 ==

Bug #14523
Fix crasher during failure to download data from rhapsody.
Comment 18 Richard Titmuss 2009-11-12 01:45:44 UTC
Ok, I have had a fab4 running for 24 hours with Rhapsody now, no errors. QA please retest.
Comment 19 Michael Valera 2009-11-12 11:44:31 UTC
My Touch still freezes instantly. Not resolved.
Comment 20 James Richardson 2009-11-12 11:49:19 UTC
Michael: you need to be on firmware 7.5.0-r8075 or higher

QA is currently testing now....
Comment 21 James Richardson 2009-11-13 09:00:18 UTC
Created attachment 6300 [details]
serial log

Latest serial capture.  Playback stoped around 8:16 am 13NOV
Comment 22 Michael Valera 2009-11-13 12:02:07 UTC
7.5.0 r8084 = instant crash

Again, can someone tell me, or point me to a place that instructs me how to get a log out of the device?
Comment 23 James Richardson 2009-11-13 12:19:21 UTC
You can use an SD card with /log folder in the root.  OR ssh into the Touch and CAT /var/log/messages (which gets wiped if you reboot)  OR use the USB to Serial cable 

https://wiki.slimdevices.com/index.php/Log_File
Comment 24 James Richardson 2009-11-18 09:43:44 UTC
Using a DEBUG build of firmware, I have not had a crash yet, but, I did have audio stop with the following error:
=======================================

Nov 17 23:00:55 squeezeplay: ^M
Nov 17 23:00:55 squeezeplay: INFO   audio.decode - decode_start_handler:274 init decoder mp3
Nov 17 23:04:26 squeezeplay: INFO   audio.decode - Playback.lua:418 connect 69.28.176.117:80 GET /1/2/2/9/5/114159221.rad HTTP/1.0^M
Nov 17 23:04:26 squeezeplay: INFO   audio.decode - Playback.lua:421 GET /1/2/2/9/5/114159221.rad HTTP/1.0^M
Nov 17 23:04:26 squeezeplay: Accept: */*^M
Nov 17 23:04:26 squeezeplay: Cache-Control: no-cache^M
Nov 17 23:04:26 squeezeplay: User-Agent: iTunes/4.7.1 (Unix; N; linux; x86_64-linux; EN; utf8) SqueezeNetwork/7.5.0-sn/TRUNK^M
Nov 17 23:04:26 squeezeplay: Icy-MetaData: 1^M
Nov 17 23:04:26 squeezeplay: Connection: close^M
Nov 17 23:04:26 squeezeplay: Host: llnw-1012.listen.com^M
Nov 17 23:04:26 squeezeplay: ^M
Nov 17 23:04:26 squeezeplay: INFO   audio.decode - decode_start_handler:274 init decoder mp3
Nov 17 23:07:31 squeezeplay: playback_callback:332 Audio underrun: used 169 frames, requested 441 frames. elapsed samples 7752838
Nov 17 23:07:36 squeezeplay: ERROR  audio.decode - src/rhapsody/rhapsody.c:282 bad response: {"cause":null,"exception":"com.real.common.ebi.exception.BusinessLogicException","localizedMessage":"Unable to Authenticate the user","message":"Unable to Au
Nov 17 23:07:36 squeezeplay: ERROR  audio.decode - src/rhapsody/rhapsody.c:586 EA failed
Comment 25 Michael Valera 2009-12-18 10:58:32 UTC
Created attachment 6392 [details]
Log from Mike

Does this help?
Comment 26 Chris Owens 2010-02-11 17:35:52 UTC
Steven, do you have Rhapsody set up that you can easily look at this?
Comment 27 Chris Owens 2010-02-25 10:01:42 UTC
Steven notes he can't reproduce this.
Comment 28 Alan Young 2010-03-08 03:59:57 UTC
rhapsody_getEA() parses a series of 8-bit integers by parsing them from an ascii input buffer. The length of this buffer is not known ahead of time and therefore neither is the number of output bytes that it may contain. The parsed bytes are temporarily stored in request_buf which is fixed at 2048 bytes. It is possible for a single input buffer to contain the input for more than 2048 bytes, and thus request_buf may be overrun. In the example I have just caught in the debugger idx == 2073.

I also note that the 'do { } while ()' loop in this function terminates on not 'err >= 0', even though 'err' is not updated in the body of the loop. At best this is confusing code. Actual loop termination is achieved with 'break' statements.

The second continue statement in that loop will leak response_buf, although this case is very unlikely in practice.
Comment 29 Alan Young 2010-03-08 04:09:56 UTC
Created attachment 6607 [details]
Proposed patch
Comment 30 Felix Mueller 2010-03-08 05:16:37 UTC
Alan - Your patch looks ok, but I think it kicks in one element too early, i.e.

  if (idx >= sizeof(request_buf)) {

would be sufficient to be

  if (idx > sizeof(request_buf)) {

If the 'while (tok != NULL)' loop happens to be done just after filling in the last allowed element (and idx now points to the first element outside the buffer) this would just be fine without need to do a partial flush.

The second thing with 'err' probably is something left over from the ssl_read() call at the top of the do - while loop. See error message which is still using 'err'. Should probably be using 'len' there.
Comment 31 SVN Bot 2010-03-08 06:25:21 UTC
 == Auto-comment from SVN commit #6681 to the player repo by ayoung ==
 == https://svn.slimdevices.com/player?view=revision&revision=6681 ==

bug 14523: Touch freezeing and rebooting when playing Rhapsody 
Avoid overrunning the temp buffer when decoding the initial EA bytes.
Comment 32 Chris Owens 2010-04-08 17:24:13 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!