Bugzilla – Bug 17173
Music Scan Terminated Unexpectedly (Directory Scan)
Last modified: 2011-11-14 05:36:35 UTC
Scanner crashes at random points during directory scan. Crash means application fault. The scan has completed once successfully but nearly always fails before the end. Downgrade to 7.5.2 fixes the problem. This may be the same bug as 16142 or 16248. However, those bugs appear not to be OK in 7.5.2 whereas mine is. There is nothing interesting in the scanner.log: just the usual directory entries, even with debug turned on. Further problem description here: http://forums.slimdevices.com/showthread.php?t=86962
These are hard to deal with, unless we have someone's entire music library to test with. Need lots more info.
(In reply to comment #1) > These are hard to deal with, unless we have someone's entire music library to > test with. Need lots more info. I have a workaround - downgrade to 7.5.2. So,if you think this will be fixed by other changes, perhaps in 7.5.5 or 7.6 then OK, I'll just hang on. But, on the other hand, if we need to get this fixed, then I'm willing to help. For example, I could a run a version with symbols and get you the dump so you can see the stack. That would be a good place to start. Or I could run a debug version with more logging. Since I can currently solidly reproduce the failure, then think of this as a friendly offer...
I have just rolled back from 7.5.4 r32171 to 7.5.3 r31792 and have run five consecutive “clear library” scans WITHOUT a failure. I was only able to do one consecutive scan with version 7.5.4. This is not an issue with anti-virus running, but rather an issue with 7.5.4, at least on WHS operating systems. The changes in 7.5.4 may have been small, but something has made this release unstable for a large group of users. TO ALL: if you are having this issue with the 7.5.4 release, abandon 7.5.4 and roll back to at least 7.5.3 to fix the issue.
I didn't download every 7.5.4 beta build, but I also have problems with the r32171 and r32224 scanners terminating on my XP Pro setup. In my case, I simply reverted to r31858, which seems to be scanning fine. I can't get a scan to complete on the later 7.5.4 builds. Unfortunately, I didn't save any logs from when I tried the newer 7.5.4 builds last week--sorry. I did try to restart the scans several times, and it often seemed to crash about the same time. If I simply continued the scan without deleting the database, it would continue for a short period of time, and would crash again. Current WORKING Squeezebox Server Status Version: 7.5.4 - r31858 @ Sun Feb 6 03:19:43 PST 2011 Operating system: Windows XP - EN - cp1252 Platform Architecture: 586 Perl Version: 5.10.0 - MSWin32-x86-multi-thread MySQL Version: 5.0.22-community-nt
Andy, I can confirm that the scanner crashes with version 7.5.4 but works just fine with 7.5.3. Strickler
Happens for me also with 7.54, on WHS. Doesn't happen on 7.53 Repeated "Scan terminated unexpectedly"; takes about 4 consecutive scans to scan entire library. Even when scan finishes, the "My Music>Artists" appears as "empty". Curious, as under "Genres">artists the artists are listed.
*** This bug has been confirmed by popular vote. ***
I have this same scanner.exe crash on my WHS machine at 7.5.4 r32171. To correct the crash I just copied the scanner.exe file from a 7.5.3 r31792 install and left all other files at 7.5.4 level. I would also mention that a dup bug has been opened as bug 17178.
*** Bug 17219 has been marked as a duplicate of this bug. ***
I have had a lot of problems with this issue as well. I bought a HP WHS mainly for running Squeezebox Server, but version 7.4.5 stopped during music scan. I have tried both the SBS for WHS but also the Windows version on my HP server. I used the work around as Wilkes described - THANK you for sharing!
same here (WHS, Scanner crashes on 7.5.4). Unfortunately, the workaround (scanner.exe from 7.5.3) doesn't work for me. I'll try to go back to 7.5.2 and hope this works for a while.
Scanner in 7.5.4 also crashes for me on Windows XP. I suspect I haven't previously attempted a rescan since upgrading but it crashes fairly consistently around 6k tracks into a library of ~50k tracks, though not in the same place each time. There are no specific errors or warnings in either the server or scanner log files. I tried restarting the scan but it crashed multiple times and the database was corrupt (50054 tracks but 0 artists). Have rolled back to 7.5.3 and this appears to be working OK
I am experiencing the same issue running 7.5.4 on a Qnap NAS. I have SBS configured to look for new and changed music nightly. I crashes about once every week. Having to restart it is getting quite old. I can give Andy ssh access to my system if needed, just let me know.
could somebody please provide a scanner log with all scan options set to debug? Thanks!
Created attachment 7322 [details] scanner.log for scan which terminates unexpectedly
Created attachment 7323 [details] server.log for the same run as scanner.log starting from previous boot
First I did the scan with 7.5.2 - r31632 Clear library and rescan completed in 1:07:26 with 19,225 tracks. I don't usually run as administrator so can't use the automatic update. Logged off and logged on as administrator. Ran the standard 7.5.4 install downloaded from Logitech Rebooted and logged on as standard user. Went to Squeezebox Control Panel -> Advanced -> Advanced Settings Settings Browser Control (in Chrome) -> Advanced -> Logging Set scan,scan.import,scan.scanner all to Debug -> Apply Back to Squeezebox Control Pane -> Status -> Clear library and rescan Status shows Directory Scan and starts to list music files. Scanner process uses between 64 and 71MB Mem Usage but no strong upward trend Status shows Music scan terminated unexpectedly (Directory Scan) Scanner and server logs attached - though I can't see anything in them :-) Hope this helps Other details: OS: Windows XP SP3, fully patched Antivirus: Microsoft Security Essentials Excluded Files and Locations: C:\Documents and Settings\All Users\Application Data\Squeezebox\Cache\MySQL Excluded File Types: MYD;MYI Excluded Processes: mysqld.exe
Created attachment 7325 [details] zipped up windows mini-dump for the scanner.exe
I then logged on as Administrator I then get the Windows Error Reporting message for the scanner crash I've attached the mini-dump for that error reporting I've now re-installed 7.5.2 and started a new scan I expect that will complete successfully but if not I will add another update on here.
OK that was unexpected! Running the scan under 7.5.2 also failed, this time with a message in the log: 11-06-29 12:44:29.6146] Slim::Utils::Scanner::scanDirectory (333) Scanning: N:\Audio\Lib\Classical\Shostakovich\Symphonies\Symphony No. 4\04. III. Largo.flac [11-06-29 12:44:30.0781] Slim::Schema::forceCommit (1622) Warning: Trying to commit transactions before DB is initialized! I'll try again.
And second time everything seems to have worked OK. Oddly (a coincidence?) the first time (when it failed) the scanner was using 63M again, just like under 7.5.4. The second time, when the scanner succeeded, it used much less memory peaking at under 30M. It was also much slower, taking 1:55:20. Does the scanner have two different memory usage modes?
Created attachment 7331 [details] My scanner.log with the same problem. Also nothing unusual (that I noticed, at least) in my scanner log - just the filename of the last successfully scanned file. At that point, I get a popup from Windows telling me that scanner.exe has crashed.
When I tried the workaround (7.5.2 scanner), I ended up with a duplicated library, as the MusicIP import step duplicated every track in the library. So I'm stuck with the latest version, but it crashes over and over and over again. I too am volunteering to run a version with extra debug options if that's available.
I think my issues with the workaround may be because I was trying scanner.exe from 7.5.3, not 7.5.2. Does anyone have a link to the old versions?
(In reply to comment #24) > I think my issues with the workaround may be because I was trying scanner.exe > from 7.5.3, not 7.5.2. Does anyone have a link to the old versions? Scans in stages. Eventually sees everything. Shows artists as 0. As a result cannot search by artist. Music library is on an external hard drive.
I tested 7.5.5 on XP, W7 & WHS. No crash. So there must be some conditions under which the scanner crashes. Could you please give us some information about your library? What file formats are you using? Are you using embedded artwork or separate cover art files? Shortcuts/hyperlinks to other folders? Playlists inside your music folders?
(In reply to comment #26) > Could you please give us some information about your library? Sure, and thanks for looking into this. Overall library size (as reported by the 7.5.2 scanner): 7522 albums with 80442 songs by 3830 artists. Organized into some top-level folders, then sub-folders like so: Artist/Album/Track 01.flac, etc. Scanner is running on Win XP Pro SP 3. Library is on an Infrant ReadyNAS NV. > What file formats are you using? Mix of MP3 & FLAC, almost always as separate files, maybe 1% of folders have a .cue file. > Are you using embedded artwork or separate cover art files? Separate files in each album directory, usually cover.jpg or folder.jpg. > Shortcuts/hyperlinks to other folders? No. > Playlists inside your music folders? Almost none. Nearly all playlists are inside a dedicated "Playlists" folder. Scanner crashes before reaching that folder. Other notes: -Scanner crash points are not consistent. -Crash happens on both "clear & re-scan" as well as "new & changed music." -I am using MusicIP, but only importing "mixable" status. What else can I tell you?
More questions: is anybody using tracks bought from iTunes?
I've installed 7.5.5 on both a WHS v1 and a Win7 box. Clear and rescan is working fine on both these boxes @ 7.5.5 (I've done multiple Clear and rescans with no trouble). Clear and rescan would crash on the WHS box @ 7.5.4. My music library has not changed from the 7.5.4 scanner.exe WHS crash to the 7.5.5 successful Clear and rescan, music is mostly mp3 with a few flac albums. In answer to Michael's question... No tunes from itunes and no itunes integration.
(In reply to comment #28) > More questions: is anybody using tracks bought from iTunes? Nope, no iTunes downloads in my library.
thanks for the feedback on your collections. The latest 7.6 nightly build has some additional logging built in to the scanner. Could you please give it another try? It will hopefully give us more information about the failures. Thanks!
Created attachment 7334 [details] 7.6 scanner & server log files I don't see any errors, but maybe you'll see something useful in here. It got pretty far on the first clear & re-scan.
Thank Jordan. Unfortunately I can't unzip that file. What tool did you use to compress it?
Created attachment 7335 [details] 7.6 logs - with winzip legacy compression Sorry about that, I used Winzip but had it set to "best compression method" instead of "winzip 2.0 legacy compression" and sometimes that causes problems.
*** Bug 17240 has been marked as a duplicate of this bug. ***
Here's the current plan for working on this bug: I am going to be building Windows installers for each successive Audio::Scan module change. The installers will contain the latest 7.6 code, with the only difference between them being the Audio::Scan build. When these builds are available (probably sometime tomorrow) I would like anyone experiencing this crash to use them to find the first version where the crash occurs. This should let us narrow down which change caused the problem. And hopefully everyone will be able to agree on the first version where the crash started. Thanks.
Here we go, there are 12 different builds to try, numbered 47 through 58. The first build (47) contains Audio::Scan 0.84 and should be a working one, and the final build (58) contains the current 0.87. If you are experiencing scanner crashes, please test and let me know the earliest build that fails for you. The most efficient way to do this is by using a binary search: Try the middle build first (52), if it fails, try the build halfway between it and the beginning, if it works, take the build halfway between it and the end. Repeat until you have narrowed it down to a single build. Also, you should probably do a complete uninstall each time, and please do not ever mix and match files from different SBS builds (e.g. scanner.exe). This can cause all kinds of problems. Thanks for your help guys.
And of course, I forgot the download link! http://downloads.slimdevices.com/bug17173/
Before fixing the actual bug, it would be a good time to fix the scan progress display. From bug 17240: NB. Also, the Web UI Settings > Information Music Scan Details section reports that the scan has finished, but doesn't indicate that it failed/crashed. It still reports "Scanning new files", and the scan phase time and total time continue to update forever.
r32755 crashes. Tried it 4 times, 4 crashes. The scanner log (set to debug) just says "Slim::Utils::Scanner::Local::new (677) Handling new track" and the name of the track which was different for each crash. I will add a log as an attachment. r32752 OK r32755 crashed r32753 OK r32754 OK r32755 crashed on 3 runs with scanner logging set to debug. A complete uninstall and delete of cache and prefs was performed before each install of a new version. The music library was all mp3 and is a subset of my normal library.
Created attachment 7337 [details] r32755 scanner log
== Auto-comment from SVN commit #862 to the opensource repo by agrundman == == http://svn.slimdevices.com/opensource?view=revision&revision=862 == Bug 17173, possible fix, cannot assume bptr will remain the same after a _check_buf
== Auto-comment from SVN commit #863 to the opensource repo by agrundman == == http://svn.slimdevices.com/opensource?view=revision&revision=863 == Bug 17173, cleaned up a few more places where invalid memory reads could occur (rarely used AAC and MPC code)
Thanks very much for your help John. Can you please test this new build, 32761? http://downloads.slimdevices.com/bug17173/SqueezeboxServer-7.6.0-32761.exe
Oops, I forgot to allow for the new module version, please don't use that build and wait for me to post a new one.
OK, this is the build to test (32762): http://downloads.slimdevices.com/bug17173/SqueezeboxServer-7.6.0-32762.exe Thanks!
(In reply to comment #46) > OK, this is the build to test (32762): > http://downloads.slimdevices.com/bug17173/SqueezeboxServer-7.6.0-32762.exe > > Thanks! I'm still testing the builds John posted last night - should I skip those and just test the new one you just posted, Andy? Thanks.
You could first make sure that 32755 does also crash for you. If it does, try the newest build.
I updated to SVN 32762 and tried a full rescan. Still crashing for me.
Philip: Well that's not good. Do you have the same results as John with 32754 being OK and 32755 crashing?
r32762 completed scan. A complete uninstall and delete of cache and prefs was performed before the installation. The library was the same a previous tests.
Great news John, I am concerned about Philip's results though.
Its definately worth Phil testing the other versions if he can cause a crash with the latest one. I suspect there are other cases where corrupt files could cause a crash, but think the fix should resolve frequent problems with mp3...
(In reply to comment #50) > Philip: Well that's not good. Do you have the same results as John with 32754 > being OK and 32755 crashing? > Maybe I'm missing something here? I updated SVN for 7.6/trunk to 32762 and did a full rescan. I tried reverting to 32754, but there were no changes to revert. I thought 7.6/trunk now included onebrowser and was including all of the changes. You weren't meaning 32754 on some other branch (LMS) were you?
Yes please see back a few posts. These builds are on a branch so if you are using svn you will need to switch.
(In reply to comment #55) > Yes please see back a few posts. These builds are on a branch so if you are > using svn you will need to switch. Ah, right. I looked through every post, and could not see any mention of a branch for this testing, only a sub-folder on the download server for getting the installer version. Anyway, I've found the branch 7.6/branches/bug17173 and will try that.
So far, so good with SVN 7.6/branches/bug17173 revision 32763. Scanner currently running still, but it's been running for 20 mins without a hiccup - much longer than it's ever gone before. I've had to manually abandon the scan for now, as I needed to reboot. I will rescan tomorrow to fully confirm.
(In reply to comment #48) > You could first make sure that 32755 does also crash for you. If it does, try > the newest build. Thanks, Andy. I can confirm that 32577 did indeed crash for me. I'll try the latest build now.
(In reply to comment #58) > (In reply to comment #48) > > You could first make sure that 32755 does also crash for you. If it does, try > > the newest build. > > Thanks, Andy. I can confirm that 32577 did indeed crash for me. I'll try the > latest build now. Sorry, I mean 32755.
r32762 - This build has been installed on my "production" box and my mini-ITX test box and completed a clear & rescan on both boxes. Both boxes were stuck on 7.6 r32108. All 3 boxes (Test sever, HTPC and mini-ITX) run XP SP3, have identical music libraries on 2TB and 1.5TB Samsung eco-green drives, different motherboards and cpus, however, they are software identical (except for motherboard drivers and graphics cards). Thank you Andy, I'll keep monitoring this bug and will test further versions as required.
r32762 worked perfectly for me. Completed a wipe & rescan, which it hasn't done successfully since 7.5.2. Thank you for the fix!
== Auto-comment from SVN commit #32772 to the slim repo by agrundman == == http://svn.slimdevices.com/slim?view=revision&revision=32772 == Fixed bug 17173, Audio::Scan 0.88: - ADTS AAC: Check first 2-3 frames to avoid false syncs. - Win32: Display better error messages when unable to read from files. - MP3, AAC, MPC: Cleaned up several places where invalid memory reads could occur.
Yes - the fix works for me. Thanks.
Hi - sorry to report I am still having issues with scanner aborts and have had to go back to 7.5.3 31792 to be able to perform a full scan. I attempted to go to the new 7.7.0 33614 which has the same issue. (Had to load new 2010 C++ runtime libraries from www.microsoft.com/download/en/details.aspx?id=8328) - did not attempt to or was requested to uninstall earlier (2005?) C++ runtime libs. Each time, the existing version specifically uninstalled before earlier/later one installed. Other releases tried: 7.7.0 r-33614 scanner fault. 7.6.9 r-32901 cant make it work at all - time display works on sbox, web interface not workng, scanner not working - database locked error in log. 7.5.4 r-32171 scanner fault 7.5.3 r-31792 - works ok Server running on WHS SP2 latest updates. Have not tried the version stated as providing a fix r32762 as would like to take advantage of latest other fixes etc. relating to 7.7.... Any ideas please? Was frustrated to see this problem still in the later/latest releases - looks like it's a tricky one - happy to run a debug version and provide some more detailed logs and sample music file - it was I believe aborting at the same place each time. Existing log system didn't tell which music file it was having issues with if it's even file specific. Is there a way to run the scanner manually with more debug options set? Library is around 15K tracks, all work ok with the earlier versions. By the way, no A/V running on WHS box, only native Windows Firewall - I know it doesn't do A/V (:) Many thanks Pete