Skip to content

gh-104839: Prevent test_venv AddressSanitizer spam #105005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,14 @@ def test_zippath_from_non_installed_posix(self):
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.
Expand Down