Weird bug when loading content from a compressed file (zip or 7z). It has to do with the file extension?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
[Edit 07/16/2021] I specified the wrong RA versions when I created the issue (v1.4.0 instead of v1.9.4), now they are correct.
Description
Weird bug when loading content from a compressed file (zip or 7z). If the file inside is named with certain file extensions, then RetroArch throws an error like "Failed to extract content from compressed file: /path/to/compressed_file.7z#ASegaGenesisGame.68k" ("68k" is a supported extension by the Genesis Plus GX core). However, if that name has another file extension (e.g. "ASegaGenesisGame.bin"), the content is loaded sucessfully without errors.
The log file says nothing other than the error message even if the logging level is set to 0 (Debug).
The content can have any supported file extension when it's not compressed and be loaded correctly, but this doesn't work if it's in a compressed file.
Expected behavior
The content has to be loaded regardless its file extension from the compressed file without issues.
Actual behavior
It shows a notification saying "Failed to extract content from compressed file" and...
Prior v1.9.4:
- For compressed 7z files, it actually extracts and loads the content despite the notification.
- For zip files: on v1.9.2, it loads the content once despite the notification, and crashes at the second time with "double free or memory corruption". On v1.9.1, (apparently) it gets stuck in an infinite loop.
On v1.9.4 (stable):
- It doesn't load the content and it won't let me play the game compared to the previous version.
Steps to reproduce the bug
- Open the frontend and boot to the menu
- Go to Import content.
- Select a directory with a compressed file which contains a file named with a file extension that may cause an error (e.g. "68k" extension).
- Go to the corresponding playlist.
- Select the entry that points to a content in a compressed file (see the path) (e.g. "/path/to/compressed_file.7z#ASegaGenesisGame.68k")
- Select "Play" to start the content. It should show notification that says "Failed to extract content from compressed file" and the game won't start (or something from the "Actual behaviour" section).
Bisect Results
I just installed RetroArch for Android (apk file from buildbot) and I thought that I may save storage memory if I create a zip file for every content file. But when I tried to load the content, it got stuck in an infinite loop (v1.9.1). I tried to replicate the bug on Windows and Linux, and it happened the same exact thing.
Version/Commit
You can find this information under Information/System Information
Tested versions
- RetroArch: 1.9.1 (stable), 1.9.2 (stable), 1.9.3 (stable), 1.9.4 (stable / c226bd87f4)
Environment information
For versions 1.9.1 to 1.9.3:
- OS: Zorin OS 15.3 (based on Ubuntu 18.04) 64-bit; Android (v1.9.1 (32-bit build) only) 4.4 and 7.0; Windows 10 version 1709 64-bit
For version 1.9.4:
- OS: Zorin OS 15.3 (based on Ubuntu 18.04) 64-bit
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue through Import content, the playlist entry, and playback using a compressed file containing a supported .68k file. Start by tracing RetroArch's compressed-content extraction and extension handling for ZIP and 7z archives across the reported versions. Done means supported content loads from either archive without the extraction error, crashes, or loops.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100