From: Jesse Noller Date: Tue, 31 Mar 2009 22:20:35 +0000 (+0000) Subject: Issue 5619: Pass MS CRT debug flags into subprocesses X-Git-Tag: v2.7a1~1659 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42f9b4e5b4fff45ef4a071112787de6b29a5099a;p=thirdparty%2FPython%2Fcpython.git Issue 5619: Pass MS CRT debug flags into subprocesses --- diff --git a/Misc/ACKS b/Misc/ACKS index 401b29ee2f03..d5b055cd9028 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -685,6 +685,7 @@ Daniel Stutzbach Nathan Sullivan Mark Summerfield Hisao Suzuki +Andrew Svetlov Kalle Svensson Paul Swartz Thenault Sylvain diff --git a/Misc/NEWS b/Misc/NEWS index 6bded6b0f072..aa99ac005cb9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -199,6 +199,9 @@ Core and Builtins Library ------- +- Issue #5619: Multiprocessing children disobey the debug flag and causes + popups on windows buildbots. Patch applied to work around this issue. + - Issue #5632: Thread.ident was None for the main thread and threads not created with the threading module. diff --git a/Modules/_multiprocessing/win32_functions.c b/Modules/_multiprocessing/win32_functions.c index 513fc02b1a5d..549c15198301 100644 --- a/Modules/_multiprocessing/win32_functions.c +++ b/Modules/_multiprocessing/win32_functions.c @@ -130,6 +130,12 @@ win32_ExitProcess(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "I", &uExitCode)) return NULL; + #if defined(Py_DEBUG) + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG); + #endif + + ExitProcess(uExitCode); return NULL; diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d0c5b2bf3484..b3866cebb88c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1634,6 +1634,8 @@ void Py_FatalError(const char *msg) { fprintf(stderr, "Fatal Python error: %s\n", msg); + fflush(stderr); /* it helps in Windows debug build */ + #ifdef MS_WINDOWS { size_t len = strlen(msg);