Bug #82695 Exception information missing from minidump files written on Windows
Submitted: 23 Aug 2016 13:35 Modified: 24 Aug 2016 21:07
Reporter: Daniel Blanchard Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Windows Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[23 Aug 2016 13:35] Daniel Blanchard
Description:
The my_create_minidump function in the mysys library calls the Windows API function MiniDumpWriteDump (see https://msdn.microsoft.com/en-us/library/ms680360(v=vs.85).aspx ) with an incorrect value (NULL) for the ExceptionParam parameter. This results in exception information being omitted from the minidump file.  

The incorrect NULL value is being passed due to a logic error in an existence test applied to the process handle for which the minidump is created.

This lack of exception information creates difficulties when using the minidump to diagnose crashes caused by exceptions such as access violations.

How to repeat:
Modify the code of an application that uses the my_create_minidump function in its exception handling (such as mysqltest) to provoke an access violation - for example by dereferencing a null pointer.  This should result in the creation of minidump. 

Load the minidump into the WinDbg Windows debugging tool and execute the .ecxr (Display Exception Context Record) command. The command will fail as the minidump does not contain the necessary exception context data.

Suggested fix:
Change the expression used for the ExceptionParam parameter to the MiniDumpWriteDump call in the my_create_minidump function from
  process ? NULL : &info
to 
  process ? &info : NULL
[24 Aug 2016 21:07] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Server 8.0.1 release, and here's the changelog entry:

The my_create_minidump function in the mysys library called the Windows
API function MiniDumpWriteDump with an incorrect value (NULL) for the
ExceptionParam parameter. This resulted in exception information being
omitted from the minidump file.

Thank you for the bug report.