Bug 13995 - unhandled pointer error inside Format::readTags results in scanner hang
: unhandled pointer error inside Format::readTags results in scanner hang
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Formats
: 7.4.0
: Macintosh MacOS X 10.5
: P1 major (vote)
: 7.4.0
Assigned To: Andy Grundman
: Audio::Scan
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-11 19:10 UTC by dan cohn
Modified: 2009-10-05 14:29 UTC (History)
3 users (show)

See Also:
Category: Bug


Attachments
file causing scanner to idle indefinitely (702.50 KB, application/octet-stream)
2009-09-11 19:13 UTC, dan cohn
Details
proposed patch (776 bytes, patch)
2009-09-11 19:17 UTC, dan cohn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dan cohn 2009-09-11 19:10:15 UTC
despite being inside an eval, a condition still exists where a call in readTags can result in a hung scanner. the use statement being evaluated is not enough to determine an error will not continue to occur.

this may be fixed with the following patch:

*** /Users/dan/slimdev/slim/7.4/trunk/server/Slim/Formats.pm    2009-09-09 20:18:47.000000000 -0700
--- /Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Slim/Formats.pm        2009-09-11 19:05:40.000000000 -0700
***************
*** 165,171 ****
                        if (my $tagReaderClass = $class->classForFormat($type)) {
                                if ( !$loadedTagClasses{$type} ) {
                                        eval "use $tagReaderClass";
!                                       if ( $@ ) {
                                                logError("Unable to load $tagReaderClass: $@");
                                                return {};
                                        }
--- 165,171 ----
                        if (my $tagReaderClass = $class->classForFormat($type)) {
                                if ( !$loadedTagClasses{$type} ) {
                                        eval "use $tagReaderClass";
!                                       if ( $@ || !$loadedTagClasses{$type}) {
                                                logError("Unable to load $tagReaderClass: $@");
                                                return {};
                                        }

test on the attached mp3, which will cause a repeatable failure.
Comment 1 dan cohn 2009-09-11 19:13:46 UTC
Created attachment 5836 [details]
file causing scanner to idle indefinitely
Comment 2 dan cohn 2009-09-11 19:17:04 UTC
Created attachment 5837 [details]
proposed patch
Comment 3 James Richardson 2009-09-11 20:29:00 UTC
Andy: your thoughts on this?  is the patch OK to check in
Comment 4 Andy Grundman 2009-09-11 20:56:14 UTC
Thanks for the file, that reveals a bug in Audio::Scan's average bitrate calculation.

Your patch doesn't solve the problem, that would just avoid loading any tag scanners.  I'll work on the Audio::Scan issue.
Comment 5 SVN Bot 2009-09-11 21:14:34 UTC
 == Auto-comment from SVN commit #423 to the opensource repo by andy ==
 == https://svn.slimdevices.com/opensource?view=revision&revision=423 ==

Fixed bug 13995, fixed divide by zero error when trying to detect MP3 average bitrate on a file with no valid frames
Comment 6 Andy Grundman 2009-09-11 21:20:43 UTC
BTW that is one seriously corrupted MP3 file.  A good test though. :)
Comment 7 James Richardson 2009-10-05 14:29:58 UTC
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server!
    * SqueezeCenter: 28672
    * Squeezebox 2 and 3: 130
    * Transporter: 80
    * Receiver: 65
    * Boom: 50
    * Controller: 7790
    * Radio: 7790  

Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes

If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.