Skip to content

Commit f21eb18

Browse files
rcj1Rachel Jarvi
andauthored
Adding proper exiting and cleanup logic for singlefile createdump (#117286)
* adding proper exiting and cleanup logic for singlefile createdump * simplifying code change --------- Co-authored-by: Rachel Jarvi <racheljarvi@microsoft.com>
1 parent 645d049 commit f21eb18

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/coreclr/pal/src/thread/process.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,7 @@ PROCCreateCrashDump(
22392239
else if (childpid == 0)
22402240
{
22412241
// Close the read end of the pipe, the child doesn't need it
2242+
int callbackResult = 0;
22422243
close(parent_pipe);
22432244

22442245
// Only dup the child's stderr if there is error buffer
@@ -2252,7 +2253,12 @@ PROCCreateCrashDump(
22522253
SEHCleanupSignals(true /* isChildProcess */);
22532254

22542255
// Call the statically linked createdump code
2255-
g_createdumpCallback(argv.size(), argv.data());
2256+
callbackResult = g_createdumpCallback(argv.size(), argv.data());
2257+
// Set the shutdown callback to nullptr and exit
2258+
// If we don't exit, the child's execution will continue into the diagnostic server behavior
2259+
// which causes all sorts of problems.
2260+
g_shutdownCallback = nullptr;
2261+
exit(callbackResult);
22562262
}
22572263
else
22582264
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy