bpo-39573: Py_TYPE becomes a static inline function #28128
Conversation
I already pushed this change in June: f3fa63e But it was reverted since it broke a Windows debug buildbot and I failed to find time to analyze why: https://bugs.python.org/issue39573#msg395205 |
buildbot/AMD64 Windows10 PR failed:
buildbot/AMD64 Windows10 Pro PR: failed
buildbot/AMD64 Arch Linux Asan Debug PR:
Hum, usually this error comes from an incremental build: a C structure changed, the compiler reused old object files (.o). buildbot/x86 Gentoo Non-Debug with X PR:
It seems like the timeout is just too low for this slow buildbot. On a previous build, the test took 21 min which is close to the timeout of 25 min: https://buildbot.python.org/all/#/builders/344/builds/151
|
For the |
I created python/buildmaster-config#262 to increase "/x86 Gentoo Non-Debug with X" buildbot timeout: python/buildmaster-config@eeff117 @Fidget-Spinner: "For the test_exceptions bug, there's an issue at https://bugs.python.org/issue44348. Some time ago I proposed that we need to increase stack size on windows." Right, I'm aware of that. But I was optimistic and hoped that the bug gone magically :-) For test_exceptions, my notes on the stack size and stack overflow on a recursion error on Windows: https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion |
I created https://bugs.python.org/issue45094 for the test_exceptions stack overflow. |
I converted this PR to a draft until https://bugs.python.org/issue45094 is fixed. I pushed changes to test if Py_ALWAYS_INLINE (PR #28141) would fix the test_exceptions on Windows when Python is built in debug mode. |
Oh, it seems like adding __declspec(noinline) didn't fix test_exceptions, or my PR has an issue, or __declspec(noinline) is ignored when Python is built in debug mode.
|
I pushed a change to run the test suite with a debug mode on Windows (commit " [WIP] GitHub Action: Windows uses a debug build"): tests now pass thanks to my test_exceptions fix! |
Convert the Py_TYPE() and Py_SIZE() macros to static inline functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be used to set an object type and size.
I removed the debug commits of this PR (since tests pass) and I removed the Draft status. |
Don't use _PyObject_CAST() which doesn't exist in old Python versions.
The compile step failed with "RuntimeError: subprocess not supported for isolated subinterpreters". This issue is unrelated to this PR. |
cb15afc
into
python:main
Convert the Py_TYPE() and Py_SIZE() macros to static inline
functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be
used to set an object type and size.
https://bugs.python.org/issue39573