https://bugs.winehq.org/show_bug.cgi?id=48482
Bug ID: 48482 Summary: Star Wars Knights of the Old Republic randomly crashes after failed malloc Product: Wine Version: 5.0-rc6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winelib Assignee: wine-bugs@winehq.org Reporter: info@fdossena.com Distribution: ArchLinux
Created attachment 66272 --> https://bugs.winehq.org/attachment.cgi?id=66272 winedbg output of the crash
I'm trying to play Star Wars Knights of the Old Republic (KOTOR, for short) and the game randomly crashes on loading screens when played in Wine.
The crash is a null pointer exception (see attached kotorcrash.txt). Nothing special appears in the terminal, the crash was captured using winedbg.
The issue can be easily replicated by saving in front of a loading door and going back and forth a few times. It usually happens after 5-10 loads, so during normal gameplay the game crashes every 30 minutes or so, depending on the area.
My reverse engineering skills are minimal, but I know how to use IDA a bit, so I took a peek at the offending code with it (see attached isassembled.png). The instruction can be reached from 2 paths, one of which contains a malloc that I think is failing and returning 0. Why it fails I cannot tell. I tried placing a breakpoint but it gets called too often to be able to play the game (I need some way to break only if it returns 0, but I don't know how to do it).
I think malloc is part of winelib, so I chose that as the component for this bug report, if it's wrong please move it to the correct section.
I am willing to help you debug the issue further if you can tell me exactly what do to. I can also provide game files or saved games to replicate the issue if you contact me via email.
Software: * Manjaro Linux 18.1.5 KDE x86-64 (also tested on Ubuntu 19.10) * KOTOR version 1.0.3 from GOG (also tested with Steam and disc versions) * Wine version 5.0-rc6 built from source (also tested with 4.0.3 stable, 5.0-rc2 and 5.0-rc2 staging from package manager)
Hardware 1: * AMD Athlon 300G * 8GB DDR4 * AMD RX Vega 3 graphics (using open source amdgpu driver)
Hardware 2: * Intel Core i9 9900k * 64GGB DDR4 * nVidia GTX 1080 (using both the open source nouveau driver and the proprietary one)
I've also tried playing in software rendering using Mesa Gallium on LLVMPipe, the issue was still present. Note: the game currently doesn't work on Intel graphics due to driver issues.