-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Game crashes when running with MIDI #69
Comments
The game also crashes on exit when I'm using eawpats. |
You're on Windows, right? I remember having similar issues. It might be caused by using the wrong build of |
Yes, I'm on Windows 7, 64-bit. I'll try doing the same thing you did. |
Yes, that worked. And then I built the Release build of wildmidi and used that, and the crash returned. So, back to the Debug build. |
Nice find. You building with MSVC? Have you tried using our binaries from WildMIDI 0.4.1? |
Yeah, I'm using Visual Studio 2015. I set up CMake to build OpenTESArena with the wildmidi-0.4.1-win64/msvc folder just now, and it runs fine in Visual Studio, but if I run the executable itself with If I build and use the debug version of |
I also use MSVC 2015. From the binaries, do you mean wildmidi.exe and wildmidi-static.exe in the msvc folder of WildMIDI 0.4.1? I tried it, and at first it didn't start because of not finding wildmidi.cfg. I copied that into the folder and tried it on a midi, and while the program ran, I got no sound. It was a Daggerfall midi and maybe it's not supported? And, it crashes when I exit the program. So, either I'm not using it right or there are some problems with it. |
I just realized that all of my Windows releases contain the debug .dll of WildMIDI which requires vcruntime140d.dll (something the typical user doesn't need on their computer. I didn't notice this in the dependency walker until now, either). I've also accidentally been mixing different versions of I'm not sure how the WildMIDI releases could fix this other than maybe linking against a newer MSVC runtime (like MSVCR120.dll instead of MSVCR80.dll), because using the .dll that comes with the release causes the crash. |
I tried the |
Can anyone run this in a debugger and pinpoint where and when the crash happens? |
For the test, I built OpenTESArena with:
The debugger stops with an error message about "A heap has been corrupted" in In CMake, I selected the This error does not occur when I build WildMIDI myself and use its |
I don't know if this is an acceptable solution/workaround, but commenting out allows me to use the release version of the WildMIDI .dll without crashing when I start the game. |
Here is the WildMIDI source code for Still not sure why there's that crash in |
Yeah I thought removing those could result in memory leaks but also wondered if maybe they're trying to free resources that were already freed somehow. psi29a, does it look to you like OpenTESArena is doing things correctly and this is most likely a problem on the WildMIDI side? |
FWIW, commenting out the statements as mentioned above, using a release build of wildmidi_dynamic.dll and running with Dr. Memory, a program that's supposed to monitor for and catch leaks, it didn't complain about any leaks. When running with the release build .dll with the statements not commented out and using Dr. Memory, the program doesn't crash like it does without Dr. Memory. It gave the following report information at two points where the program would normally have crashed (when loading a level from the main menu and when exiting the program.) Loading a level
Exiting the program
|
An update. First, I tried a Release build of the latest WildMidi, but the problem remains. I tracked down to the exact line where the crash occurs. If you comment out this line, no crash will occur. |
Nice work @Allofich |
Hi psi29a, I tried with the latest master just today, so it's not fixed. I'll go ahead and add a bug report, though. |
Thanks, I'll also have a deep dive into this around lunch. I'm wondering if this platform specific, if not then we can try to reproduce this on Linux. |
This issue is fixed in willdmidi master branch. |
Yes, I agree. I will go ahead and do so. afritz1 if you want it back open for any reason go ahead and re-open. |
If I run the game with MIDI active, it crashes when I click "Start New Game."
Specifically, if I have eawpats.zip extracted into the Data folder, the game starts and plays MIDI, but crashes when I click Start New Game. If I don't have eawpats in the Data folder, the game doesn't crash.
The text was updated successfully, but these errors were encountered: