[SERVER-23071] Windows crash dump during fatal assertion does not contain exception record Created: 10/Mar/16  Updated: 05/Jul/16  Resolved: 17/Jun/16

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 3.3.3
Fix Version/s: 3.3.9

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Robert Guo (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Prepare a debug Windows build of mongod.exe and start it with test commands enabled:

start mongod.exe --dbpath D:\mongodb\data --logpath D:\mongodb\data\mongod.log --setParameter enableTestCommands=1
 
E:\workspace\mongo>mongo.exe --nodb
MongoDB shell version: 3.3.2-156-gad2b483
> use admin;
 
// This command will cause fassert to be generated at shutdown. This does not contain exception information.
assert.commandWorked(db.runCommand({ configureFailPoint: "crashOnShutdown", mode: "alwaysOn", data: { how: 'abort' } }));
 
// This command will cause segfault to be generated at shutdown. This generates the correct exception info.
> assert.commandWorked(db.runCommand({ configureFailPoint: "crashOnShutdown", mode: "alwaysOn", data: { how: 'fault' } }));

Sprint: TIG 16 (06/24/16)
Participants:

 Description   

The Windows crash dump, which gets generated during a fatal server assertion does not contain exception record, which makes it useless in diagnosing failures.

The stack trace, which gets printed is correct, but it looks like the place at which the stack dump is generated is after the stack containing the exception has unwound.

If the crash happened due to access violation, the exception record is correct.



 Comments   
Comment by Githook User [ 17/Jun/16 ]

Author:

{u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robertguo@me.com'}

Message: SERVER-23071 use system exception handler to generate minidump
Branch: master
https://github.com/mongodb/mongo/commit/1eae564e0ac849584aa14f368abb5f1867a7f789

Comment by Robert Guo (Inactive) [ 15/Jun/16 ]

It seems like the problem is caused by the MiniDumpWriteDump method requiring a manual population of its PMINIDUMP_EXCEPTION_INFORMATION parameter. This blog post suggests that this is a known issue and is documented on MSDN, but I didn't find the original article after some brief Googling. http://blog.aaronballman.com/2011/05/generating-a-minidump/

On our side, the segfault correctly produces the minidump because it goes through our Windows specific exception handler, specified in SetUnhandledExceptionFilter, which does correctly populate the exception information. fasserts and invariant failures are handled by our endProcessWithSignal, which does not pass in the exception.

The solution would be to route all exceptions to use our Windows exception handler, call the minidump from another thread, or to generate the exception information ourselves.

Generated at Thu Feb 08 04:02:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.