Grimrock.exe stopped working

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Grimrock.exe stopped working

Post by cromcrom »

It's so weird. I have had a 4 hours crashless session, same dungeaon, same every thing. It might have something to see with Steam and steam cloud ?
A trip of a thousand leagues starts with a step.
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Grimrock.exe stopped working

Post by JohnWordsworth »

If there is anything more I can send you Petri, just let me know. I'm happy to install the Windows 7 SDK with the debugging tools and send you any profiling / debugging reports that I can generate from here if it's of any help to you.

Thanks for your perseverance in hunting down these little issues. It's this attention to detail and wonderful support of the community that makes you guys excellent.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Grimrock.exe stopped working

Post by petri »

Argh, still haven't found a way to reproduce this. I'm pretty sure it happens only when a dungeon has been loaded, preview has been started and then stopped. I wonder if the bug happens only with a certain dungeon. Can anyone confirm the crash with the default new dungeon?

I.e. does it crash with the following sequence:
1) start grimrock
2) open dungeon editor
3) create a new dungeon
4) start preview
5) stop preview
6) wait
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Grimrock.exe stopped working

Post by JohnWordsworth »

Hi Petri, I wonder if it only happens with Dungeons that were created using a previous version of the Dungeon Editor? I think I'm still loading up an old Dungeon that I started a couple of versions ago. I can confirm that I made it crash at one point after loading a dungeon but without ever starting preview though.

I'm afraid I'm not working from home today, but I'll test it this evening with a fresh dungeon following your instructions above and let you know what the results are!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Grimrock.exe stopped working

Post by petri »

Ok, I got a repro now but unfortunately I still have no clue why the dll gets unloaded. Seems almost like a bug in XAudio2 itself.
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: Grimrock.exe stopped working

Post by Shroom »

I can get it to crash do nothing except start a new dungeon.

A google of XAudio2 does show that it crashes in other games when the dll is unloaded. I can also set up a number of VM test systems if it would be of any help. :ugeek:
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Grimrock.exe stopped working

Post by petri »

I just spent almost the entire day tracking this down. What I found out really surprised me. Apparently there is a bug in XAudio2 or Windows COM system which causes the XAudio2 dll to be seemingly randomly unloaded even when it is still in use! COM has a low priority thread which scans for unused DLLs in the background, and if it finds one it adds it to "clean up list". If the dll remains in the clean up list for 10 minutes, it is unloaded. The problem is that XAudio2 dll should not be cleaned up in the first place because it is used by the app.

Microsoft knows about this bug and one of their people even insists that XAudio2 is not meant to be used on Windows, even when XAudio2 is now a system component in Windows 8 :roll:

More details if you are really interested:
http://social.msdn.microsoft.com/Forums ... 26a3221f91

Luckily there is a nasty workaround which can be used to force the dll to stay in memory. I'll add it to next version so let's hope this fixes those nasty crashes.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Grimrock.exe stopped working

Post by Komag »

NICE! Good hunting there. glad there is at least a workaround, however crappy it may be.
Finished Dungeons - complete mods to play
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Grimrock.exe stopped working

Post by petri »

The "nasty workaround" is in the just released beta 1.2.10.
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: Grimrock.exe stopped working

Post by Shroom »

Well 'nasty' or not, it works! Nice Work :)

I have had the editor open longer than ever before and its still going \o/

Am a happy bunny.
Post Reply