OpenJKDF2
OpenJKDF2 copied to clipboard
Crashes when opening certain Episodes in DEBUG mode or multiplayer game host menu [Linux]
Dark Forces 2: Crash when trying to open "The Force Within" episode Mysteries of The Sith: Crash when trying to open "Mysteries of The Sith" or "Sith Multiplayer Duel" episodes. [DEBUG] menu give the next terminal output:
openjkdf2: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)
Multiplayer host game menu gives the following terminal output:
malloc(): invalid size (unsorted)
Aborted (core dumped)
I'm having the same issue on both master and v0.9.1. I had previously compiled and run OpenJKDF2, and didn't have any issue at the time. So, I checked the commit I was using last time, b79b8c210878b6f276ed3d1a5dad91d9219e6ce1, and did a bisect. For me at least, it seems the issue was introduced in 31f6318268cf8a6294e22db6fbc562379c82b061. If I use 314f24ce48d5b46d41869761d695fd85855940e7, I can open the host game menu just fine.
I'm having the same issue on both master and v0.9.1. I had previously compiled and run OpenJKDF2, and didn't have any issue at the time. So, I checked the commit I was using last time, b79b8c2, and did a bisect. For me at least, it seems the issue was introduced in 31f6318. If I use 314f24c, I can open the host game menu just fine.
You're right, the issue is related to the string changes on line 380 and 402 of jkGUISingleplayer.c. Either the call to free() on these strings is wrong, or the realloc itself is broken.
Fix staged for v0.9.5