Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
355 stars 55 forks source link

Wargus 3.1.0 crash at start on Win7 32B (portable and no-portable) #372

Closed psa-jforestier closed 2 years ago

psa-jforestier commented 3 years ago

Describe the bug When lauching Wargus.exe (or Debug mode, or Safe graphic mode), a console window pop and close, and the app crash with :

Signature du problème :
  Nom d’événement de problème:  APPCRASH
  Nom de l’application: wargus.exe
  Version de l’application: 3.1.0.0
  Horodatage de l’application:  60e0ad73
  Nom du module par défaut: KERNELBASE.dll
  Version du module par défaut: 6.1.7601.24545
  Horodateur du module par défaut:  5e0eb7d0
  Code de l’exception:  c0000005
  Décalage de l’exception:  0000c510
  Version du système:   6.1.7601.2.1.0.256.48
  Identificateur de paramètres régionaux:   1036
  Information supplémentaire n° 1:  0a9e
  Information supplémentaire n° 2:  0a9e372d3b4ad19135b953a78882e789
  Information supplémentaire n° 3:  0a9e
  Information supplémentaire n° 4:  0a9e372d3b4ad19135b953a78882e789

Same with AntiVirus deactivated, and launch in Administrator mode.

To Reproduce

I installed the portable version, extract data from GOG Version (in french), but extract tools said "Detected BNE CD" (selecting install.mpq) . All the extraction worked.

The Wargus.exe never work : it crashes just after poping a console window (I do not have to see if something is written on it). If I launch Wargus.exe from a CMD.EXE command line in the Wargus directory, a window appears saying "wargus could not find its extraction tool.", even with -p -i. If I launch Wargus.exe from a Bash shell located in Wargus directory, a console window appears and close, and the program write "segmentation fault" in the bash console.

Whetever the case is (click on the shortcut, command line start), there is no "crash.dmp" file generated or stdout/stderr.txt file.

I also tested with the no-portable version, and this is the same problem (extraction work, but crash at startup at any mode).

With Stratagus.exe

Launching Stratagus.exe on the portble directory do not display anything (no window appearing), but stdout and stderr file are created, but they are empty. It generates also a crash.dmp (see attached).

Expected behavior Having a crash dump to analyze, or a stderr.txt, or something in the console.

Screenshots and Logs Add screenshots to help explain your problem. If you encountered the issue inside a game, please add the log from the game (find it in "My Documents/Stratagus/wc2/logs" on Windows or "$HOME/.stratagus/wc2/logs" on Linux). Please also attach your stderr and stdout. If you're on Windows, these will be in "My Documents/Stratagus/std*.txt"

Desktop (please complete the following information):

psa-jforestier commented 3 years ago

crash.zip

timfel commented 3 years ago

Thanks for opening the issue. We had a few reports of the game no longer working on older Windows versions. Unfortunately, none of the developers uses Windows 7 anymore (it is also no longer supported by Microsoft, I just noticed). So I don't know if and when this will be fixed - it is possible we will just drop support officially, unless someone who knows how to fix this can contribute some code :/

psa-jforestier commented 3 years ago

Hello. Thank for your message. It motivates me to try to fix it by myself ;) So I dowloaded VSStudio, VSCode and all the build chain, and watched the video you provided to build on Windows. The problem is somewhere near https://github.com/Wargus/stratagus/blob/cf563a3e0d4e147f73f851c7d91ff746dfad0c09/src/video/sdl.cpp#L284 . On my W7 box, the SHCORE.DLL does not exist and is not loaded so the SetProcessDpiAwareness pointer is undefined, but the program enter in L285 trying to call the undefined function pointer. I iniatialize the pointer to NULL before loading the DLL, and now the program jump to the "Vista" branch.

Now I'm able to launch Stratagus, in Windowed mode, but without OpenGL (or it crashes! ) . Command line is "stratagus.exe -g -W -a -d c:\PathToData.wargus"

I also fixed several strcat() call on a non-intialized buffer, resulting in a crash in https://github.com/Wargus/stratagus/blob/cf563a3e0d4e147f73f851c7d91ff746dfad0c09/gameheaders/stratagus-game-launcher.h#L638 .

I will provide a PR in a few hours.

timfel commented 2 years ago

Fixed