Skip to content

Commit

Permalink
There's a new expected error code on Windows with the static runtime;…
Browse files Browse the repository at this point in the history
… try harder to get the right tags from macOS GitHub runners.
  • Loading branch information
jamadden committed Aug 30, 2023
1 parent f1005b9 commit 8277b1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
run: |
python setup.py bdist_wheel
python -m pip install -U -e ".[test,docs]"
# Something in the build system isn't detecting that we're building for both,
# so we're getting tagged with just x86_64. Force the universal2 tag.
# (I've verified that the .so files are in fact universal, with both architectures.)
wheel tags --remove --abi-tag universal2 dist/*whl
env:
# Unlike the above, we are actually distributing these
# wheels, so they need to be built for production use.
Expand Down
13 changes: 12 additions & 1 deletion src/greenlet/tests/test_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,30 @@ def _do_test_unhandled_exception(self, target):
# ERROR_PATH_NOT_FOUND; BUT: the C runtime abort() function
# also uses this code.
#
# If we link to the static C library on Windows, the error
# code changes to '0xc0000409' (hex(3221226505)), which
# apparently is STATUS_STACK_BUFFER_OVERRUN; but "What this
# means is that nowadays when you get a
# STATUS_STACK_BUFFER_OVERRUN, it doesn’t actually mean that
# there is a stack buffer overrun. It just means that the
# application decided to terminate itself with great haste."
#
# See
# https://devblogs.microsoft.com/oldnewthing/20110519-00/?p=10623
# and
# https://docs.microsoft.com/en-us/previous-versions/k089yyh0(v=vs.140)?redirectedfrom=MSDN
# and
# https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655
expected_exit = (
-signal.SIGABRT,
# But beginning on Python 3.11, the faulthandler
# that prints the C backtraces sometimes segfaults after
# reporting the exception but before printing the stack.
# This has only been seen on linux/gcc.
-signal.SIGSEGV
-signal.SIGSEGV,
) if not WIN else (
3,
0xc0000409,
)
self.assertIn(p.exitcode, expected_exit)

Expand Down

0 comments on commit 8277b1e

Please sign in to comment.