Repository navigation
always_inline makes build fail with -Og and --without-pydebug #121266
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jul 2, 2024 However, we're not using --with-pydebug since that has had side effects that broke multiple third-party packages in the past.
Would you mind to elaborate? The ABI is now the same between release and debug build since Python 3.8.
Back when I've tried debugging an assertion failure and enabled
--with-pydebug, I've ended up hitting different failures in dependencies even before I managed to get to "my" failure. It was #108295 (comment) back then.I proposed PR gh-121493 to remove Py_ALWAYS_INLINE. I'm not sure if my PR is correct.
- added a commit that references this issue
on Jul 10, 2024 If there are problems with
Py_ALWAYS_INLINEincompare_unicode_generic(),compare_unicode_unicode()andcompare_generic(), I assume their*_threadedversions are affected, too, since they also have those asserts?
Except forcompare_generic_threadsafe(), where the
assert(ep->me_key != NULL);
IMHO would be an improvement (or at least not hurt)?Or maybe just for symmetry those should't use
Py_ALWAYS_INLINEif their non-threaded versions don't?OTOH, if those
assertsare the culprit and you are unsure about the performance impact of removing thePy_ALWAYS_INLINE(see #issuecomment-2213996110), you could use an#ifdef NDEBUG, but is it worth the hassle?Since there is the convenient pyperformance infrastructure let's measure?
The issue should now be fixed in 3.13 and main branches. Thanks for the report @mgorny.
Thanks a lot!
Reacted by Victor Stinner
Bug report
Bug description:
We're trying to build CPython to debug a crash in third-party extension. To do that, I've set
CFLAGS="-Og -g"and passed--with-assertions. However, we're not using--with-pydebugsince that has had side effects that broke multiple third-party packages in the past. Unfortunately, in this configuration CPython fails to build due to use ofalways_inline:CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs