Skip to content
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

Conquest Frontier Wars crashes with v0.3.0 #96

Closed
elishacloud opened this issue Apr 29, 2021 · 4 comments
Closed

Conquest Frontier Wars crashes with v0.3.0 #96

elishacloud opened this issue Apr 29, 2021 · 4 comments

Comments

@elishacloud
Copy link

The wrapper crashes with v0.3.0 (and v0.2.1), but works fine with v0.2.0 on Conquest Frontier Wars, I am using the GOG version. It crashes after restarting a game or leaving a game. I tried with the debug version and the game won't even play at all. The release version with debug logs actually works better than the regular release version and is much harder to make the game crash (sorry for the large log files here).

Debug build crashes on launch:
DDrawCompat-Conquest-Debug.zip

Release build with debug logs (takes longer to crash the game):
DDrawCompat-Conquest.zip

@narzoul
Copy link
Owner

narzoul commented May 1, 2021

I'm unable to reproduce the crash with either "restart mission" or "resign", and it's not clear from the logs what goes wrong. Can you check a crash dump?

@elishacloud
Copy link
Author

elishacloud commented May 3, 2021

For some reason no crash dumps are created, the game just seems to exit by itself. If you use the release build without logs it seems to crash easier. Here are the steps:

  1. Click "Single Player"
  2. Select "Campaign"
  3. Select "Terran Campaign"
  4. Click on the circle to select Mission 1.
  5. Click "Start" to start the mission.
  6. Once the mission is started, press ESC to bring up the menu and then exit the mission.
  7. Once the mission is exited, click on the circle to select Mission 1 again.
  8. Click "Start" to start the mission again.
  9. Once the mission is started, press ESC to bring up the menu and then exit the mission.
  10. If you are using the release build it will typically crash here. If not, then repeat steps 7 though 9 until crash (exits).

Edit: I believe Windows is causing the game to exit because of null pointer access. I had this issue a while back on dxwrapper and if I remember right, it had something to do with how the game handled/managed its interfaces. It was trying to use an interface that I had already deleted. Not sure if the same thing is happening with DDrawCompat here.

@narzoul
Copy link
Owner

narzoul commented May 4, 2021

Yes, I got it now, thanks. After running it through a debugger, it looks like it's accessing a deleted IDirectDrawClipper interface in updateWindowClipList (DirectDrawClipper.cpp). The Release method's hook should normally remove the deleted instances from g_clipperData, but it looks like it doesn't get invoked (at least not through the vtable) when the parent DirectDraw object is released without explicitly releasing the clipper first. I'll figure out some fix for this for the next release.

Funny, I seem to remember I caught this issue before too. It looks like I forgot to fix it though...

narzoul added a commit that referenced this issue May 16, 2021
narzoul added a commit that referenced this issue May 16, 2021
@narzoul
Copy link
Owner

narzoul commented May 16, 2021

Fixed in v0.3.1. Thanks for all the reports!

@narzoul narzoul closed this as completed May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants