2 Tests ThreadSanitizer's support to detect a leaked thread.
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
.decorators
import *
8 import lldbsuite
.test
.lldbutil
as lldbutil
11 class TsanThreadLeakTestCase(TestBase
):
14 bugnumber
="non-core functionality, need to reenable and fix later (DES 2014.11.07)",
16 @expectedFailureNetBSD
17 @skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
19 @skipUnlessThreadSanitizer
25 exe
= self
.getBuildArtifact("a.out")
26 self
.expect("file " + exe
, patterns
=["Current executable set to .*a.out"])
31 self
.dbg
.GetSelectedTarget().process
.GetSelectedThread().GetStopReason()
33 if stop_reason
== lldb
.eStopReasonExec
:
34 # On OS X 10.10 and older, we need to re-exec to enable
36 self
.runCmd("continue")
38 # the stop reason of the thread should be breakpoint.
41 "A thread leak should be detected",
42 substrs
=["stopped", "stop reason = Thread leak detected"],
46 self
.dbg
.GetSelectedTarget().process
.GetSelectedThread().GetStopReason(),
47 lldb
.eStopReasonInstrumentation
,