PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
Other
10.62k stars 1.54k forks source link

[BUG]: ISO Decompression thread crashes if you have a archive without an iso in the directory #11398

Closed behrad2k closed 2 weeks ago

behrad2k commented 2 weeks ago

Describe the Bug

ISO Decompression thread crashes with SIGSEGV if there's a archive with no ISO in it.

Reproduction Steps

  1. Make an archive with no ISO
  2. Make PSCX2 read the directory it's in

Expected Behavior

Nothing happens.

PCSX2 Revision

v1.7.1337

Operating System

Linux (64bit) - Specify distro below

If Linux - Specify Distro

Arch

Logs & Dumps

Does gdb count? if so Thread 48 "ISO Decompress" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffe83e006c0 (LWP 3592)] 0x00007ffff732c639 in inflate () from /usr/lib/libz.so.1

kamfretoz commented 2 weeks ago

Works fine here? my game dump directory has no ISO (everything is compressed with CHD) and i dont see any crashes.

I'm also running Arch too.

image

behrad2k commented 2 weeks ago

I mean archives with no ISO

kamfretoz commented 2 weeks ago

Okay yep, i managed to repro'd it with any .gz file with arbitrary content.

Crash log:

[    6.1849] This may take a while (but only once). Scanning compressed file to generate a quick access index...
[    6.1867] Gzip quick access index file saved to disk: '/home/kamfretoz/Downloads/pcsx2-qt_id-ID.tar.gz.pindex.tmp'
*************** Unhandled SIGSEGV at 0x79154e593291 ***************
  0x0058a743d59f29 LogCallstack [/home/runner/work/pcsx2/pcsx2/common/CrashHandler.cpp:284]
  0x0058a743d59e13 CrashSignalHandler [/home/runner/work/pcsx2/pcsx2/common/CrashHandler.cpp:315]
  0x0058a743d78233 SignalHandler [/home/runner/work/pcsx2/pcsx2/common/Linux/LnxHostSys.cpp:320]
  0x0079154ca494af
  0x0079154e593291
  0x0058a74390fbfb extract [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/zlib_indexed.h:467]
  0x0058a74390fbfb ReadChunk [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/GzippedFileReader.cpp:240]
  0x0058a7439112ce GetBlockPtr [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:173]
  0x0058a7439112ce Decompress [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:197]
  0x0058a7439112ce Loop [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:84]
  0x0058a7439112ce operator() [/home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:22]
  0x0058a7439112ce __invoke_impl<void, (lambda at /home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:22:29), ThreadedFileReader *> [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:61]
  0x0058a7439112ce __invoke<(lambda at /home/runner/work/pcsx2/pcsx2/pcsx2/CDVD/ThreadedFileReader.cpp:22:29), ThreadedFileReader *> [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:96]
  0x0058a7439112ce _M_invoke<0UL, 1UL> [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:279]
  0x0058a7439112ce operator() [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:286]
  0x0058a7439112ce _M_run [/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:231]
  0x0079154ccf63f3 execute_native_thread_routine [/usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104]
  0x0079154caa4a6e
  0x0079154cb23e1b
  0xffffffffffffffff
*******************************************************************
Aborting application.
stenzek commented 2 weeks ago

gzip code is utter dogshit, this is why I wanted to remove it... but nooooo