Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I determine why my process terminates
    primarykey
    data
    text
    <p>I have a problem where during a call to a 3rd party library routine my process terminates. I am completely unable to catch this in my debugger. This may be related to this question: <a href="https://stackoverflow.com/questions/378380/how-can-i-debug-a-win32-process-that-unexpectedly-terminates-silently">How can I debug a win32 process that unexpectedly terminates silently?</a>.</p> <p>When I step over a call into this library, the process being debugged simply terminates. If this termination was due to an unhandled exception or memory access violation, the debugger would have caught it. So my best guess is that the process somehow terminates normally.</p> <p><strong>What I have tried:</strong></p> <ul> <li>Setting breakpoints on <code>ExitThread</code> and <code>ExitProcess</code></li> <li>Setting handlers for unhandled exceptions and invalid paramters ( <code>set_terminate</code> and <code>_set_invalid_parameter_handler</code>)</li> <li>Changing <code>_set_abort_behavior</code> and <code>_set_error_mode</code>.</li> <li>Instructing the debugger to stop execution on all thrown exceptions.</li> </ul> <p>But to no avail, none of the handlers are called and none of the breakpoint are triggered.</p> <p><strong>What I have observed:</strong> When the process crashes, I see two things in the debug output window:</p> <ol> <li><p><strong>Not related (see update below)</strong> <strike>I see <code>EEFileLoadException</code> being thrown. A quick google of this exception doesn't give me a clear answer to whar this exception means.</strike></p> <pre><code>First-chance exception at 0x7656b9bc (KernelBase.dll) in Program.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x0030b5ac.. First-chance exception at 0x7656b9bc (KernelBase.dll) in Program.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x7656b9bc (KernelBase.dll) in Program.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.. First-chance exception at 0x7656b9bc (KernelBase.dll) in Program.exe: 0xE0434352: 0xe0434352. </code></pre></li> <li><p>When terminating, all threads return the same error code (STATUS_INVALID_CRUNTIME_PARAMETER). This error code means, as far as I can tell, that one of the c runtime functions has received an invalid parameter and the application is terminated for security reasons.</p> <pre><code>The thread 'Win32 Thread' (0x12c0) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0xe04) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x53c) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x116c) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x16e0) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x1420) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x13c4) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x40c) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0xc78) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0xd88) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x16c8) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0xcb8) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x584) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x1164) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x1550) has exited with code -1073740777 (0xc0000417). The thread 'Win32 Thread' (0x474) has exited with code -1073740777 (0xc0000417). The program '[5140] Program.exe: Native' has exited with code -1073740777 (0xc0000417). </code></pre></li> </ol> <p>What I really want to know is what causes this, and optionally; how can I catch this in the debugger?</p> <p><strong>Update</strong> Regarding the <code>EEFileLoadException</code>, it is in fact thrown before the program makes the call which causes it to terminate, so it is not related to the termination of the process.</p> <p><strong>Update</strong> I just read that <code>set_terminate</code> does not work in the debugger so that's out of the question. And as noted in my comment, the handlers are managed on a per-thread basis so I don't have access to the relevant handler.</p> <p>Also, the program most likely crashes in a worker thread which I have no access to so it is difficult to set any breakpoints/handlers at all.</p> <p>Is there a better way to figure out what goes wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload