Author Topic: Crash in bglmanx64.dll on P3D v4.1 shutdown  (Read 2223 times)

MELKOR

  • Newbie
  • *
  • Posts: 44
Crash in bglmanx64.dll on P3D v4.1 shutdown
« on: December 18, 2017, 09:35:42 pm »
I've attached the full WinDbg analysis.

STACK_TEXT: 
00000022`1673f098 00007ffc`ccff2e21 : 00000000`00000000 00000000`00000000 000001d8`00000000 00007ffc`00000005 : bglmanx64+0x19340
00000022`1673f0a0 00007ffc`ccff2aeb : 00000000`00000000 00000000`00000000 00000022`00000000 00000000`00000000 : mscoreei!CloseCtrs+0x1721
00000022`1673f170 00007ffc`ccfec96e : 00000000`00000001 00000022`00000000 00000000`00000000 00007ffc`cd9b7e70 : mscoreei!CloseCtrs+0x13eb
00000022`1673f1c0 00007ffc`ccff0b78 : 00007ffc`853f0000 00007ffc`853f0000 00000000`00000003 00007ffc`853f0000 : mscoreei!GetCORVersion+0x2ee
00000022`1673f730 00007ffc`ccff0d35 : 00000000`00000000 00000000`000000a7 00000022`1673f750 00007ffc`d74037b0 : mscoreei!GetAssemblyMDImport+0xf8
00000022`1673f850 00007ffc`cd2d1a99 : 00000000`5a000000 00000000`00000000 00007ffc`853f0000 00000000`00000003 : mscoreei!CorDllMain+0x85
00000022`1673f8d0 00007ffc`cd2d1af7 : 00000000`00000000 00007ffc`853f0000 00000022`142ae000 00007ffc`ccfd0000 : mscoree!ShellShim__CorDllMain+0xe9
00000022`1673f910 00007ffc`d7371473 : 00000000`7ffe0385 00000000`00000003 00000000`00000000 00000000`7ffe0385 : mscoree!CorDllMain_Exported+0x37
00000022`1673f940 00007ffc`d736ec84 : 00000022`142ae000 00007ffc`853f0000 00007ffc`00000003 000001d8`0c3ca590 : ntdll!LdrpCallInitRoutine+0x6f
00000022`1673f9b0 00007ffc`d73a77de : 00000000`00000000 00000000`00000000 00000000`00000010 00007ffc`00000000 : ntdll!LdrShutdownThread+0x154
00000022`1673fab0 00007ffc`d73956c0 : 00000000`00000000 00007ffc`00000000 00000022`1425d000 00000000`00000001 : ntdll!RtlExitUserThread+0x3e
00000022`1673faf0 00007ffc`d6761fe4 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!TppWorkerThread+0x1420
00000022`1673fe80 00007ffc`d73cef91 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
00000022`1673feb0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21

Let me know if you'd also like the .dmp file.

Thanks.

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50870
    • VIRTUALI Sagl
Re: Crash in bglmanx64.dll on P3D v4.1 shutdown
« Reply #1 on: December 18, 2017, 11:36:46 pm »
I'm sorry, but I cannot reproduce this, and the stack log doesn't indicate anything meaningful.

What might happening, instead, is that P3D is crashing for other reasons and, by crashing abruptly, so it's making crash our module, because it cannot receive the message to close from the sim, because the sim has crashed before being able to send it.

MELKOR

  • Newbie
  • *
  • Posts: 44
Re: Crash in bglmanx64.dll on P3D v4.1 shutdown
« Reply #2 on: December 22, 2017, 03:07:31 am »
This same crash has happened a number of times to me now.

I agree that perhaps the crash is due to something unrelated to bglmanx - I have certainly seen other weird behavior with P3D crashes due to their buggy unhandled exception handler.

What I'm going to do is attach the debugger when I start P3D, that will give an accurate stack trace when an exception occurs (i.e. before the P3D exception handler can munge things).

I'll let you know.

Thanks.

- Bill

MELKOR

  • Newbie
  • *
  • Posts: 44
Re: Crash in bglmanx64.dll on P3D v4.1 shutdown
« Reply #3 on: December 28, 2017, 12:56:59 am »
The stack is only slightly different when the crash occurs while WinDbg is attached (see attachment).

Given that bglmanx64.dll is unloaded when the crash occurs and the exception is "BAD_INSTRUCTION_PTR", this leads me to believe bglmanx64 has forgotten to unregister a callback when it's unloaded. Thoughts?

Thanks.

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 50870
    • VIRTUALI Sagl
Re: Crash in bglmanx64.dll on P3D v4.1 shutdown
« Reply #4 on: December 28, 2017, 11:07:55 am »
this leads me to believe bglmanx64 has forgotten to unregister a callback when it's unloaded. Thoughts?

bglmanx64.dll has forgot to unregister anything. If it did, it would happened each time, to every user.

What is really happening, instead, is the sim crashed for other reason, so it couldn't send the message to all connected Simconect clients, which is what they need in order to start their own clean up procedures where they, of course, unregister whatever they need to unregister.

So yes, maybe this is what is happening (a pointer is not freed, some memory is not released, a callback is not deregistered), but bglman64.dll is not the cause here, it's the victim of the sim abrupt crash caused by other reasons, which is preventing to do all its own cleanup, which is always done correctly under normal conditions, when the sim is not crashing for other reason.