summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-05-27 01:41:21 (GMT)
committerGitHub <noreply@github.com>2023-05-27 01:41:21 (GMT)
commitf625ec360324842d7123db7dfe05ca2e221eecfd (patch)
treedfc5651a946f3558f1da009f92ee65793720cf72
parent2c02c6886739f0ed420d900b2a29933bc1c5df37 (diff)
downloadcpython-f625ec360324842d7123db7dfe05ca2e221eecfd.zip
cpython-f625ec360324842d7123db7dfe05ca2e221eecfd.tar.gz
cpython-f625ec360324842d7123db7dfe05ca2e221eecfd.tar.bz2
[3.12] gh-104839: Prevent test_venv AddressSanitizer spam (GH-105005) (#105006)
gh-104839: Prevent test_venv AddressSanitizer spam (GH-105005) Pass any ASAN_OPTIONS environment variable through to the child process so that leak sanitizer being disabled on our CI and buildbots stays true in the children. (cherry picked from commit a17f160376955d369c8d332e1b1a90a6e18c852a) Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
-rw-r--r--Lib/test/test_venv.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 95944c7..5205604 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -600,15 +600,14 @@ class BasicTest(BaseTest):
ld_library_path_env = "DYLD_LIBRARY_PATH"
else:
ld_library_path_env = "LD_LIBRARY_PATH"
- # Note that in address sanitizer mode, the current runtime
- # implementation leaks memory due to not being able to correctly
- # clean all unicode objects during runtime shutdown. Therefore,
- # this uses subprocess.run instead of subprocess.check_call to
- # maintain the core of the test while not failing due to the refleaks.
- # This should be able to use check_call once all refleaks are fixed.
- subprocess.run(cmd,
- env={"PYTHONPATH": pythonpath,
- ld_library_path_env: ld_library_path})
+ child_env = {
+ "PYTHONPATH": pythonpath,
+ ld_library_path_env: ld_library_path,
+ }
+ if asan_options := os.environ.get("ASAN_OPTIONS"):
+ # prevent https://github.com/python/cpython/issues/104839
+ child_env["ASAN_OPTIONS"] = asan_options
+ subprocess.check_call(cmd, env=child_env)
envpy = os.path.join(self.env_dir, self.bindir, self.exe)
# Now check the venv created from the non-installed python has
# correct zip path in pythonpath.