-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RA 1.8.4 Segmentation fault on bad disc files #10368
Comments
The file must contain more than just null characters. RetroArch/libretro-common/streams/chd_stream.c Lines 209 to 212 in cd9ca69
I verified this behavior by creating an "empty" 2MB chd file:
More than likely, if the CHD file is corrupt in some manner, the problem is actually in the libchdr code, not RetroArch. Can you provide a stack trace illustrating the crash? Or more details on the file you're trying to load? No one will be able to fix the problem with the information you've provided. |
Code: Log: |
Sure:
|
Those logs don't really help. That's like telling a book author that there's a spelling error in chapter 3. There's a lot of stuff that happens in that one line of code because it calls into other code. You need to either provide the exact line of code where the crash is occurring (not a function call containing hundreds - if not thousands - of lines of code), or provide enough information for someone else to reproduce the error. If you're smart enough to add logs to the code, why can't you provide the exact stack trace where the error occurs? All you have to do is run it in your favorite debugger and when it crashes look at the call stack. Also, the name of the file doesn't help either. You state that the file "contains nothing but \x00.", but I've tried reproducing the problem with a file that contains nothing but null characters and couldn't, so your information is clearly incorrect (or at least incomplete). The file size may be useful, but I still need to know how you're getting passed the A 5223256 byte file containing nothing but \x00 generates a different MD5 than the one you've listed.
|
|
The contents of the CHD when extracted contain nothing but "\x00" |
Why did you create CHD? That's meaningless. |
Because that's all I could do from what you provided for steps to reproduce.
There's nothing in that statement that indicates the CHD was created from a file containing all 0s. It suggests the CHD itself contains nothing but 0s. |
There's still something missing. I created a bin file that was 0x426c026c0 bytes long to match your screenshot and converted it to a CHD. The resulting file was only 432 bytes long, not 5MB. And loading it into the scanner did not cause a crash.
|
The debugger information that you've provided shows the issue is indeed in libchdr.
https://github.com/rtissera/libchdr/blob/ad32a2deeb4a8b336d6e73d2bc79109005873941/src/chd.c#L2006 |
Thanks, what else do you think I could provide that might help? |
Just so you know, these CHD files are actual conversions from bin/cue... I've found more than one example of these '\x00' files so they can actually be created by other people. |
give the damn file. If it's made from a corrupt all 0 files it can't be 'copyrighted'. Data input bugs need the wrong data to test. And libchd should be fuzzed. As well as many other things in RA. |
Just to be clear these are all '\x00' files... not anything copyrighted. |
Thanks. So much easier to debug when you have the proper information. The problem is the version of libchdr that we're using is ignoring the error code returned by RetroArch/libretro-common/formats/libchdr/libchdr_chd.c Lines 834 to 835 in 0b92224
Which leads to a null dereference later when trying to read the file. This was fixed upstream nearly two years ago: rtissera/libchdr@e1acac6#diff-b4791a43102472fe8d3959f86bd376c4R1317 I'm going to create a PR to address this specific change, but it might be time to upgrade the entire library. |
This is a PR for new scanner code... if you're poking around with it mind taking a look or perhaps a test clone? Coincidentally, while testing the scanner code, I ran across these files that kept crashing it. |
https://github.com/libretro/RetroArch/blob/master/libretro-common/streams/interface_stream.c#L260
https://github.com/libretro/RetroArch/blob/master/libretro-common/streams/chd_stream.c#L313
This function will crash retroarch when a CHD bad disc is scanned that contains nothing but "\x00".
I traced it down using log entries to that function,
then i just took a downloaded RA 1.8.4 windows and tried to scan the bad file
and it crashes.
The text was updated successfully, but these errors were encountered: