[Python-Dev] Test failures under Windows?

Kristján Valur Jónsson kristjan at ccpgames.com
Tue Mar 31 15:27:33 CEST 2009


Right, my question to microsoft was more about making sure that a __crtMessageBox() actually does nothing, when running unattended as a service.

Also, we should be seeing the same problem in non-debug versions, since the _set_invalid_parameter_handler() is no longer called, and the default one also puts up a message box.  The Assertion is then performed _in_addition_ on debug builds:
>From ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vccrt/html/c0e67934-1a41-4016-ad8e-972828f3ac11.htm
In the following example, an invalid parameter error handler is used to print the function that received the invalid parameter and the file and line in CRT sources. When the debug CRT library is used, invalid parameter errors also throw an assertion, which is disabled in this example using _CrtSetReportMode.

Btw, I am working on finding out the test suite failures for test_multiprocessing.
K
-----Original Message-----
From: Curt Hagenlocher [mailto:curt at hagenlocher.org] 
Sent: 25. mars 2009 12:54
To: Kristján Valur Jónsson
Cc: mhammond at skippinet.com.au; David Bolen; python-dev at python.org
Subject: Re: [Python-Dev] Test failures under Windows?

2009/3/25 Kristján Valur Jónsson <kristjan at ccpgames.com>:
>
> I'm going to poke my contacts at Microsoft and ask them if there is
> a way to disable popups like this for a process that runs unattended
> and/or is running as a windows service.

MSVC has shipped with runtime library source since the 16-bit days, so
the easier thing is just to read the source code.  :)

It looks like there are two possible code paths for the assertion.
The first code path uses functions in dbgrpt[t].c and its behavior is
controlled by CrtSetReportMode and CrtSetReportFile.  The second uses
functions in assert.c and its behavior is controlled by
_set_error_mode.  Both code paths use __crtMessageBox in crtmbox.c to
actually display the message box.  This function -- when running as a
service -- will helpfully set MB_SERVICE_NOTIFICATION before calling
the USER32 MessageBox, which ensures that you'll see exactly why your
service has hung the next time you actually log in with sufficient
rights. :/

The variation that goes through assert.c should write to stderr for a
console-mode application, so it's reasonable to assume that we're
hitting the other code path -- and that Mark's suggestion to use
CrtSetReportMode would address the issue.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Python-Dev mailing list