You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ASAN false positives due to vfork() with GCC 9 #103726
Older versions of ASAN don't properly support vfork(). Python uses vfork() when available in _posixsubprocess.c. This can lead to false positive reports from ASAN. I believe this issue exists with GCC 9 (and older), but not GCC 10 (and newer). The CPython GitHub actions ASAN runner currently uses GCC 9.4.0, so it does not properly handle vfork().
I've seen these false positives in my nogil-3.12 fork. I'm unsure if you've run into them upstream.
bonus points if this can be done only under compiler versions known too old to ASAN the vfork code path so that we retain coverage of what actually gets used when possible.
Ah okay, now I understood what the title meant Disable vfork() when running under ASAN.
It will be great if we can only disable vfork() under ASAN for old gcc versions.
bonus points if this can be done only under compiler versions known too old to ASAN the vfork code path
We might also want to check the Clang version. I believe that Clang 9.0 and newer support vfork() properly:
But if I understand the issue correctly, what about just upgrading the GCC version by using the apt command for the ASAN tests?
That should work, but that means that if someone is running ASAN with an older compiler locally they may run into false positives. (That might be OK -- we could instruct people to use a newer compiler). I'm not sure which approach is better.
i'm not too worried about people using old toolchains for modern features such as ASAN. Our advice can simply be "upgrade". In my potentially biased experience people who understand what sanitizers are want the recent features and fixes for those to get more accurate results. So if just upgrading our CI and bot configs to use a more recent version is all it takes, sounds good to me.
Activity
corona10 commentedon Apr 23, 2023
@colesbury Can I take a look at it?
(Or if you prefer to submit the patch, it will be great)
gpshead commentedon Apr 23, 2023
bonus points if this can be done only under compiler versions known too old to ASAN the vfork code path so that we retain coverage of what actually gets used when possible.
corona10 commentedon Apr 23, 2023
But if I understand the issue correctly, what about just upgrading the GCC version by using the apt command for the ASAN tests?
corona10 commentedon Apr 23, 2023
Ah okay, now I understood what the title meant
Disable vfork() when running under ASAN.It will be great if we can only disable vfork() under ASAN for old gcc versions.
colesbury commentedon Apr 23, 2023
@corona10 - that would be great.
We might also want to check the Clang version. I believe that Clang 9.0 and newer support vfork() properly:
That should work, but that means that if someone is running ASAN with an older compiler locally they may run into false positives. (That might be OK -- we could instruct people to use a newer compiler). I'm not sure which approach is better.
gpshead commentedon Apr 23, 2023
i'm not too worried about people using old toolchains for modern features such as ASAN. Our advice can simply be "upgrade". In my potentially biased experience people who understand what sanitizers are want the recent features and fixes for those to get more accurate results. So if just upgrading our CI and bot configs to use a more recent version is all it takes, sounds good to me.
corona10 commentedon Apr 23, 2023
+1, I will submit the PR for it
pythongh-103726: Set up gcc-10 for ASAN
pythongh-103726: Set up gcc-10 for ASAN
corona10 commentedon Apr 24, 2023
@arhadthedev I think that this is highly related to build rather than extension modules.
[-]Disable vfork() when running under ASAN[/-][+]ASAN false positives due to vfork() with GCC 9[/+]colesbury commentedon Apr 24, 2023
I edited the issue title - I hope this is more clear (and doesn't confuse things).
pythongh-103726: Set up gcc-10 for ASAN
Merge branch 'main' into pythongh-103726
gh-103726: Set up gcc-10 for ASAN (gh-103728)
corona10 commentedon Apr 25, 2023
Now we can close the issue. Thanks for the report @colesbury
pythongh-103726: Set up gcc-10 for ASAN (pythongh-103728)
[3.11] gh-103726: Set up gcc-10 for ASAN (gh-103728) (#104794)