Wargus / stargus

Importer and scripts for Starcraft
GNU General Public License v2.0
126 stars 24 forks source link

Startool : segmentation fault when extracting Starcraft.mpq #39

Closed ThibaultLemaire closed 1 year ago

ThibaultLemaire commented 6 years ago

So I was trying to reproduce the manual extraction steps for the wiki (see #37), but startool crashed when extracting Starcraft.mpq. Here's the output :

user@box  ~/Projects/stargus/build   master  startool '/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft'
Extract from "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft" to "data"
Using mpq list file "data/mpqlist.txt"
Please be patient, the data may take a couple of minutes to extract...

Archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/install.exe"
Can't open /home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/install.exe
Could not open archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/install.exe", skipping

Archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/Install.exe"
Can't open /home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/Install.exe
Could not open archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/Install.exe", skipping

Archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/starcraft.mpq"
Can't open /home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/starcraft.mpq
Could not open archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/starcraft.mpq", skipping

Archive "/home/user/Games/battlenet/drive_c/Program Files (x86)/StarCraft/Starcraft.mpq"

extracted: files\stardat.mpq (578, 61009744 bytes)
[1]    24585 segmentation fault (core dumped)  startool 

Steps to reproduce from a clean clone of the current master :

mkdir build && cd build
cmake ..
make
mkdir data
cp ../mpqlist.txt data/
startool $path_to_starcraft_installation
shedatc commented 6 years ago

Same here from Arch's (AUR) stargus-git. Running startool $sc /tmp/ /usr/share/games/stratagus/stargus/mpqlist.txt. Here are some data about the coredump:

$ coredumpctl gdb                                                                                                                                                                                                      INSERT
           PID: 10075 (startool)
           UID: 1000 (sheda)
           GID: 1000 (sheda)
        Signal: 11 (SEGV)
     Timestamp: Mon 2018-04-02 19:49:27 CEST (3min 16s ago)
  Command Line: startool . /tmp/stargus /usr/share/games/stratagus/stargus/mpqlist.txt
    Executable: /usr/bin/startool
 Control Group: /user.slice/user-1000.slice/session-c1.scope
          Unit: session-c1.scope
         Slice: user-1000.slice
       Session: c1
     Owner UID: 1000 (sheda)
       Boot ID: 6e2fc7a2f1ca4994ad87f6cfb868274b
    Machine ID: 3e671befbdc149de9d1e421b82a60e31
      Hostname: davinel.mg.rsph.local
       Storage: /var/lib/systemd/coredump/core.startool.1000.6e2fc7a2f1ca4994ad87f6cfb868274b.10075.1522691367000000.lz4
       Message: Process 10075 (startool) of user 1000 dumped core.

                Stack trace of thread 10075:
                #0  0x00005560371fd9e6 _ZN4CMpq7explodeEPv (startool)
                #1  0x00005560371fec7b _ZN4CMpq9ExtractToEPhjP8_IO_FILE (startool)
                #2  0x00005560371f7a3d _Z12ExtractEntryPKc (startool)
                #3  0x00005560371fab1d _Z11ConvertFontPKcS0_ii (startool)
                #4  0x00005560371f435e main (startool)
                #5  0x00007fdebddeff4a __libc_start_main (libc.so.6)
                #6  0x00005560371f456a _start (startool)
shedatc commented 6 years ago

OK, I'm a noob: $sc was wrongly set. A backslash was present: drive_c/Program\ Files/StarCraft' make startool segfault while 'drive_c/Program Files/StarCraft' looks OK \o/

timfel commented 6 years ago

Good that you found it, please keep the issue open, this kind of thing should be handled by the tool :)