This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_winreg now logs "Windows exception: code 0x06ba" on Python 3.6
Type: Stage:
Components: Tests, Windows Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, python-dev, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords:

Created on 2016-03-23 13:24 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg262263 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-23 13:24
The issue #23848 (change b114dbbe2d31) enhanced the faulthandler module to log Windows exceptions with the Python traceback. It uses AddVectoredExceptionHandler(1, callback) to register the callback.

Problem: test_winreg now logs a lot of "Windows exception: code 0x06ba" messages followed by traceback. It's error RPC_S_SERVER_UNAVAILABLE (1722): "The RPC server is unavailable". It doesn't seem like a fatal error, so I'm not sure that it's worth to log it.

Is it possible to check if an exception is a fatal error or not?

Or should we explicitly ignore *this* specific error?

Note: faulthandler must be enabled manually.

Example of trace:
http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1885/steps/test/logs/stdio
----
Windows exception: code 0x06ba

Current thread 0x00000500 (most recent call first):
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_winreg.py", line 305 in test_dynamic_key
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\case.py", line 600 in run
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\case.py", line 648 in __call__
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 122 in run
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 84 in __call__
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 122 in run
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\suite.py", line 84 in __call__
  File "D:\buildarea\3.x.bolen-windows8\build\lib\unittest\runner.py", line 176 in run
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\support\__init__.py", line 1802 in _run_suite
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\support\__init__.py", line 1836 in run_unittest
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_winreg.py", line 479 in test_main
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\runtest.py", line 162 in runtest_inner
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\runtest.py", line 115 in runtest
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 306 in run_tests_sequential
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 367 in run_tests
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 405 in main
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 446 in main
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\libregrtest\main.py", line 468 in main_in_temp_cwd
  File "D:\buildarea\3.x.bolen-windows8\build\PCbuild\..\lib\test\regrtest.py", line 39 in <module>
----
msg262264 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-23 13:27
Ah, it looks like an exception contains flag, especially the EXCEPTION_NONCONTINUABLE flag. Maybe we can use this one to decide if we must log or not the exception?

By the way, is it better to log the exception code as hexadecimal (0x06ba) or decimal (1722)? Windows doc looks to prefer decimal.
msg262265 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-23 13:46
New changeset efcc48cd5bfb by Victor Stinner in branch 'default':
faulthandler: only log fatal exceptions
https://hg.python.org/cpython/rev/efcc48cd5bfb
msg262267 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-23 13:47
Ok, I added a check on the EXCEPTION_NONCONTINUABLE flag. test_winreg doesn't log exceptions anymore, but test_faulthandler still pass.
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70809
2016-03-23 13:47:39vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg262267
2016-03-23 13:46:59python-devsetnosy: + python-dev
messages: + msg262265
2016-03-23 13:27:57vstinnersetmessages: + msg262264
2016-03-23 13:24:47vstinnercreate