mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-35214: MSan workarounds for socket, time, and test_faulthandler. (GH-11375)
Add Clang Memory Sanitizer build instrumentation to work around false positives from the socket and time modules as well as skipping a couple test_faulthandler tests.
This commit is contained in:
parent
387512c7ec
commit
b474e6774d
4 changed files with 38 additions and 0 deletions
|
@ -5,6 +5,7 @@ import os
|
|||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
from test import support
|
||||
from test.support import script_helper, is_android
|
||||
import tempfile
|
||||
|
@ -19,6 +20,10 @@ except ImportError:
|
|||
|
||||
TIMEOUT = 0.5
|
||||
MS_WINDOWS = (os.name == 'nt')
|
||||
MEMORY_SANITIZER = (
|
||||
sysconfig.get_config_var("CONFIG_ARGS") and
|
||||
("--with-memory-sanitizer" in sysconfig.get_config_var("CONFIG_ARGS"))
|
||||
)
|
||||
|
||||
def expected_traceback(lineno1, lineno2, header, min_count=1):
|
||||
regex = header
|
||||
|
@ -252,6 +257,8 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
3,
|
||||
'Segmentation fault')
|
||||
|
||||
@unittest.skipIf(MEMORY_SANITIZER,
|
||||
"memory-sanizer builds change crashing process output.")
|
||||
@skip_segfault_on_android
|
||||
def test_enable_file(self):
|
||||
with temporary_filename() as filename:
|
||||
|
@ -267,6 +274,8 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
|
||||
@unittest.skipIf(sys.platform == "win32",
|
||||
"subprocess doesn't support pass_fds on Windows")
|
||||
@unittest.skipIf(MEMORY_SANITIZER,
|
||||
"memory-sanizer builds change crashing process output.")
|
||||
@skip_segfault_on_android
|
||||
def test_enable_fd(self):
|
||||
with tempfile.TemporaryFile('wb+') as fp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue