tnevolin / thinker-doer

Modifications to a SMACX Thinker mod to highlight more game features
GNU General Public License v2.0
27 stars 3 forks source link

Game crashing after ending human turn #103

Closed gonX closed 2 years ago

gonX commented 2 years ago

Alpha Centauri Autosave 1.SAV.gz

Game crashes during AI turn before human gets control back.

Using WtP 277, with PRACX 1.11, though the crash happens without PRACX as well.

Probably worth noting I play on WINE (under Linux), but the crash looks to be internal to WtP.

If I run terran.exe instead of terran_mod.exe and finish the turn there is no crash.

WINE gives this dump:

Unhandled exception: page fault on read access to 0x169b432a in 32-bit code (0x7132a83b).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:7132a83b ESP:0021a89c EBP:0021a978 EFLAGS:00010212(  R- --  I   -A- - )
 EAX:169b4320 EBX:0021a944 ECX:00f8ea68 EDX:00040000
 ESI:00f8e9b8 EDI:0021a944
Stack dump:
0x0021a89c:  7130c382 a2e29436 00040000 00000008
0x0021a8ac:  00f8ea70 00000088 00f8e9b8 00f8e9c0
0x0021a8bc:  71310e10 0021a944 00f8e9b8 00000008
0x0021a8cc:  7130c310 00ed1a68 0000012f 00ebbea0
0x0021a8dc:  00ed1970 00ed1998 00ebbe44 00000001
0x0021a8ec:  00eba390 00000000 3ffe0000 00ebe7e4
Backtrace:
=>0 0x7132a83b EntryPoint+0x294bb() in thinker (0x0021a978)
  1 0x7130c382 EntryPoint+0xb002() in thinker (0x0021a978)
  2 0x71310e10 EntryPoint+0xfa90() in thinker (0x0021a978)
  3 0x7131161a EntryPoint+0x1029a() in thinker (0x0021fd8c)
  4 0x71309847 EntryPoint+0x84c7() in thinker (0x0021fd8c)
  5 0x0052828e in terranx_mod (+0x12828e) (0x0021fd8c)
  6 0x0052ad00 in terranx_mod (+0x12ad00) (0x0021fdbc)
  7 0x0045fb05 in terranx_mod (+0x5fb05) (0x0021fdd0)
  8 0x100080f3 ?PRACXHook@@YGXPAUHINSTANCE__@@@Z+0x17e3() in prax (0x0021fea4)
  9 0x00646d7d in terranx_mod (+0x246d7d) (0x0021ff30)
  10 0x7b62dcb0 ActivateActCtx+0x23400() in kernel32 (0x0021ff48)
  11 0x7bc576f7 A_SHAFinal+0x37e07() in ntdll (0x0021ff5c)
  12 0x7bc57db0 A_SHAFinal+0x384c0() in ntdll (0x0021ffec)
0x7132a83b EntryPoint+0x294bb in thinker: movswl        0xa(%eax),%eax
Modules:
Module  Address                 Debug info      Name (42 modules)
PE        350000-  3aa000       Deferred        combase
PE        3b0000-  3f8000       Deferred        dplayx
PE        400000-  a0c000       Export          terranx_mod
PE        a10000-  acb000       Deferred        winmm
PE        ad0000-  b2e000       Deferred        dsound
PE       1ba0000- 1c7a000       Deferred        soundx
PE       1e90000- 1ef7000       Deferred        winepulse
PE      10000000-10051000       Export          prax
PE      61740000-61782000       Deferred        advapi32
PE      62b80000-62b88000       Deferred        api-ms-win-core-localization-l1-2-1
PE      62fc0000-6304d000       Deferred        rpcrt4
PE      63480000-6348c000       Deferred        version
PE      63bc0000-63bd9000       Deferred        shcore
PE      64a40000-64a94000       Deferred        shlwapi
PE      64ec0000-64fec000       Deferred        oleaut32
PE      663c0000-66448000       Deferred        winspool
PE      66b00000-66b3c000       Deferred        win32u
PE      67840000-6784a000       Deferred        psapi
PE      67d40000-67d6c000       Deferred        mmdevapi
PE      67ec0000-6888e000       Deferred        shell32
PE      697c0000-69840000       Deferred        ddraw
PE      6a040000-6a062000       Deferred        msacm32
PE      6a280000-6a32c000       Deferred        msvcrt
PE      6a400000-6a531000       Deferred        ole32
PE      6ac80000-6ac87000       Deferred        api-ms-win-core-fibers-l1-1-1
PE      6bb00000-6bb25000       Deferred        msvfw32
PE      6bc00000-6bc2c000       Deferred        sechost
PE      6bcc0000-6bd3f000       Deferred        setupapi
PE      6c9c0000-6ca46000       Deferred        gdi32
PE      6cc40000-6cd9a000       Deferred        comctl32
PE      6de80000-6de88000       Deferred        api-ms-win-core-synch-l1-2-0
PE      6ed00000-6ef4f000       Deferred        user32
PE      70b40000-70c17000       Deferred        ucrtbase
PE      70d00000-70e08000       Deferred        comdlg32
PE      71200000-7121c000       Deferred        imm32
PE      71300000-71856000       Dwarf           thinker
PE      7a840000-7a844000       Deferred        opengl32
PE      7b000000-7b0e7000       Deferred        kernelbase
PE      7b600000-7b819000       Dwarf           kernel32
PE      7bc00000-7bca2000       Dwarf           ntdll
PE      7dd50000-7dd54000       Deferred        winex11
PE      7e670000-7e674000       Deferred        wined3d
Threads:
process  tid      prio (all id:s are in hex)
00000020 (D) C:\AlphaCentauri\terranx_mod.exe
        00000024    0 <==
        00000154    0
        00000158   15
        0000015c   15
        00000160   15
        00000164    0
        00000168   15
        0000016c    0
        00000178    0
00000038 services.exe
        0000003c    0
        00000040    0
        0000004c    0
        00000084    0
        000000c8    0
        000000e0    0
        00000100    0
        00000180    0
00000044 winedevice.exe
        00000048    0
        00000054    0
        00000058    0
        0000005c    0
        000000ec    0
0000007c winedevice.exe
        00000080    0
        00000088    0
        0000008c    0
        00000098    0
        0000009c    0
        000000a0    0
00000090 explorer.exe
        00000094    0
        000000a8    0
        000000b4    0
        000000b8    0
000000c0 plugplay.exe
        000000c4    0
        000000cc    0
        000000d0    0
        000000d4    0
000000d8 svchost.exe
        000000dc    0
        000000e4    0
        000000e8    0
000000f8 rpcss.exe
        000000fc    0
        00000104    0
        00000108    0
        0000010c    0
        00000110    0
        00000114    0
00000148 conhost.exe
        0000014c    0
System information:
    Wine build: wine-6.22
    Platform: i386
    Version: Windows 7
    Host system: Linux
    Host version: 5.12.4-156-tkg-pds
gonX commented 2 years ago

Somehow I was able to play the turn differently and it didn't happen on the uploaded save. It did however happen again later in the game - here's another save which should be easier to reproduce: 211203 Eligor of the Gaians, 2400.SAV.gz

The backtrace was slightly different this time, although the crashing function was the same one:

=>0 0x7132a83b EntryPoint+0x294bb() in thinker (0x00ec7090)
  1 0x7130c32f EntryPoint+0xafaf() in thinker (0x00ec7090)
  2 0x7138cdfd in thinker (+0x8cdfd) (0x00ec7090)
  3 0x71310cd4 EntryPoint+0xf954() in thinker (0x0021a978)
  4 0x7131161a EntryPoint+0x1029a() in thinker (0x0021fd8c)
  5 0x71309847 EntryPoint+0x84c7() in thinker (0x0021fd8c)

If you need any other details, like ini settings, etc. let me know. I'm pretty sure I play with mostly default settings.

gonX commented 2 years ago

Not sure how, but manually cross-compiling thinker.dll with i686-w64-mingw32 stops the crash from occurring for me.

I'm going to close the issue as its likely just wasting everyones time at this point - if I find anything more concrete I'll open a new issue.