PDA

View Full Version : BUFFER OVERFLOW - Troubleshooting scanner.exe over network from WinXP to CS-406e



pavelz
2006-12-28, 07:21
Can anyone please explain why the scanner won't accept the files on the network share - even though it clearly has permissions to open them?

Is my UNC path too long for the buffer the code allocates? I only count 82 characters ...

2006-12-28 03:50:03.0808 About to look for files in \\192.168.2.33\public\test
2006-12-28 03:50:03.0843 For files with extensions in: [(?i-xsm:\.(?:ape|wma|asf|wax|asx|lnk|wpl|shn|wav|wave| mp3|mp2|m3u|pls|xspf|flc|flac|m4a|mov|m4b|mp4|cue| mp+|mpc|ogg|aif|aiff|lnk)$)]
2006-12-28 03:50:04.7968 scanDirectory: Didn't find any valid files in: [\\192.168.2.33\public\test]

The following is a list of file activity from filemon (sysinternals.com) for the first song in the given directory - scroll to the right to see the SUCCESS / BUFFER OVERFLOW return values.


3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand
SUCCESS Options: Open Access: Read-Attributes
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand SUCCESS FileBasicInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand SUCCESS Options: Open Access: 00100080
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand BUFFER OVERFLOW FileFsVolumeInformation
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand BUFFER OVERFLOW FileAllInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\ SUCCESS Options: Open Directory Access: 00100001
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\ SUCCESS FileBothDirectoryInformation: Days Of Open Hand
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\ SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS Options: Open Directory Access: 00100001
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS FileBothDirectoryInformation: *
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS FileBothDirectoryInformation
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ NO MORE FILES FileBothDirectoryInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS Options: Open Access: 00100080
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 BUFFER OVERFLOW FileFsVolumeInformation
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 BUFFER OVERFLOW FileAllInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS Options: Open Directory Access: 00100001
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS FileBothDirectoryInformation: 01 Tired Of Sleeping.mp3
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS Options: Open Access: Read-Attributes
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS FileBasicInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS Options: Open Access: Read-Attributes
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS FileBasicInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS Options: Open Access: 00100080
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 BUFFER OVERFLOW FileFsVolumeInformation
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 BUFFER OVERFLOW FileAllInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS Options: Open Directory Access: 00100001
3:50:03 AM scanner.exe:3124 DIRECTORY \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS FileBothDirectoryInformation: 01 Tired Of Sleeping.mp3
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\ SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS Options: Open Access: Read-Attributes
3:50:03 AM scanner.exe:3124 QUERY INFORMATION \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS FileBasicInformation
3:50:03 AM scanner.exe:3124 CLOSE \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\01 Tired Of Sleeping.mp3 SUCCESS
3:50:03 AM scanner.exe:3124 OPEN \\192.168.2.33\public\test\Suzanne Vega\Days Of Open Hand\02 Men In A War.mp3 SUCCESS Options: Open Access: 00100080

I've seen this FAQ (http://faq.slimdevices.com/index.php?action=artikel&cat=2&id=99) and I followed the advice to use the IP address in the UNC path instead of server name.

If I move all the files back to the WinXP, things will work, but I will loose the benefits of hosting my music on the NAS device.

Actually - now I tried moving the .mp3 file directly into the test directory (leaving it on the share, but shortening the filename needed to get to it) and it works.

If this is indeed a buffer overflow problem, can you please release a patch for scanner.exe sometime soon?

Thanks, Pavel

pavelz
2006-12-28, 07:26
Adding version info:

SlimServer Version: 6.5.1 - 11048 - Windows XP - EN - cp1252
Perl Version: 5.8.8 MSWin32-x86-multi-thread
MySQL Version: 5.0.22-community-nt

snarlydwarf
2006-12-28, 08:53
http://blogs.technet.com/markrussinovich/archive/2005/05/17/buffer-overflows.aspx seems to imply that is not a bug in the scanner, windows or filemon. (Well, perhaps a display bug in filemon).

At any rate, what you are seeing is a result code from a Windows system call. Scanner.exe calls Windows and says, "Please give me information about this file" and Windows is returning the "sorry, no can do, buffer is full" message.

Why not use the debugging flags of Slimserver itself to see what the problem is? Debugging based on system calls is not the ideal way to do it...

pavelz
2006-12-28, 09:26
You're right about the filemon false positive overflow message.

I turned on all the debug flags and run the scanner again. The scanner just seems to ignore all the files in those directories on the server.

Next I tried copying four files closer to the root (on the network share). The scanner found them fine. Then I run the scanner again on the original location deeper in the directory structure (with --wipe flag). Surprisingly, this time it found the 4 files I copied before, but not the rest of the album in that same directory.

I don't think I'm seeing a permission issue here, I wonder if there is a problem with the code that's reconciling the existing and new entries in the database.

I assume the scanner.exe is compiled from the perl module. Is there any way I can debug that perl module myself?
Can someone please post a quick link for how to do that? Can I step through the code or would I need to dump to collections to the standard output?