| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
The current code leaves the first event in the trace part uninitialized
(from the previous thread). It can cause unpredictable behavior
during stack/mutexset restoration.
Initialize the first event to a fake harmless memory access.
llvm-svn: 224834
|
|
|
|
|
|
| |
Usually we roll the variable declaration into the condition in cases like this.
llvm-svn: 224755
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and
OverrideCommonFlags() functions, which are only supposed to be
called during initialization.
Test Plan: regression test suite
Reviewers: kcc, eugenis, glider
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6741
llvm-svn: 224736
|
|
|
|
|
|
|
| |
stack0/mset0 contained bogus values from the previous thread
that used the same id
llvm-svn: 224702
|
|
|
|
| |
llvm-svn: 224701
|
|
|
|
|
|
| |
they are required to handle synchronization on volatile/final fields
llvm-svn: 224697
|
|
|
|
|
|
|
|
|
|
| |
Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(),
so that this object can be easily tested. Enforce
that ParseCommonFlagsFromString() and SetCommonFlagsDefaults()
work only with singleton CommonFlags, shared across all sanitizer
runtimes.
llvm-svn: 224617
|
|
|
|
| |
llvm-svn: 224575
|
|
|
|
|
|
| |
see the added comments for details, it's messy
llvm-svn: 224531
|
|
|
|
|
|
|
| |
signal handler reads sa_sigaction when a concurrent sigaction call can modify it
as the result in could try to call SIG_DFL or a partially overwritten function pointer
llvm-svn: 224530
|
|
|
|
|
|
|
|
| |
tctx==NULL crash observed during deadlock reporting.
There seems to be some bugs in the deadlock detector,
but it is still useful to be more robust during reporting.
llvm-svn: 224508
|
|
|
|
|
|
| |
see the comment for details
llvm-svn: 224507
|
|
|
|
| |
llvm-svn: 224353
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Turn "allocator_may_return_null" common flag into an
Allocator::may_return_null bool flag. We want to make sure
that common flags are immutable after initialization. There
are cases when we want to change this flag in the allocator
at runtime: e.g. in unit tests and during ASan activation
on Android.
Test Plan: regression test suite, real-life applications
Reviewers: kcc, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6623
llvm-svn: 224148
|
|
|
|
|
|
|
| |
These are fake and not actual PCs, more like function IDs.
Pass them to external symbolizer untouched.
llvm-svn: 224022
|
|
|
|
| |
llvm-svn: 223732
|
|
|
|
| |
llvm-svn: 223730
|
|
|
|
|
|
| |
so that user does not map something there ahead of us
llvm-svn: 223456
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: No functionality change.
Test Plan: make check-all
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6472
llvm-svn: 223164
|
|
|
|
|
|
|
|
|
|
|
| |
Return a linked list of AddressInfo objects, instead of using an array of
these objects as an output parameter. This simplifies the code in callers
of this function (especially TSan).
Fix a few memory leaks from internal allocator, when the returned
AddressInfo objects were not properly cleared.
llvm-svn: 223145
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D6462
llvm-svn: 223121
|
|
|
|
| |
llvm-svn: 222228
|
|
|
|
| |
llvm-svn: 221936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This flag can be used to specify the format of stack frames - user
can now provide a string with placeholders, which should be printed
for each stack frame with placeholders replaced with actual data.
For example "%p" will be replaced by PC, "%s" will be replaced by
the source file name etc.
"DEFAULT" value enforces default stack trace format currently used in
all the sanitizers except TSan.
This change also implements __sanitizer_print_stack_trace interface
function in TSan.
llvm-svn: 221469
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.
Test Plan: compiler-rt test suite
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6140
llvm-svn: 221409
|
|
|
|
|
|
|
|
|
|
|
|
| |
# Make DataInfo (describing a global) a member of ReportLocation
to avoid unnecessary copies and allocations.
# Introduce a constructor and a factory method, so that
all structure users don't have to go to internal allocator directly.
# Remove unused fields (file/line).
No functionality change.
llvm-svn: 221302
|
|
|
|
| |
llvm-svn: 221297
|
|
|
|
|
|
|
|
|
|
| |
AddressInfo contains the results of symbolization. Store this object
directly in the symbolized stack, instead of copying data around and
making unnecessary memory allocations.
No functionality change.
llvm-svn: 221294
|
|
|
|
| |
llvm-svn: 221287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TSan used to do the following transformations with data obtained
from the symbolizer:
1) Strip "__interceptor_" prefix from function name.
2) Use "strip_path_prefix" runtime flag to strip filepath.
Now these transformations are performed right before the stack trace
is printed, and ReportStack structure contains original information.
This seems like a right thing to do - stripping is a detail of report
formatting implementation, and should belong there. We should, for
example, use original path to source file when we apply suppressions.
This change also make "strip_path_prefix" flag behavior in TSan
consistent with all the other sanitizers - now it should actually
match *the prefix* of path, not some substring. E.g. earlier TSan
would turn "/usr/lib/libfoo.so" into "libfoo.so" even if strip_path_prefix
was "/lib/".
Finally, strings obtained from symbolizer come from internal allocator,
and "stripping" them early by incrementing a "char*" ensures they can
never be properly deallocated, which is a bug.
llvm-svn: 221283
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the place where TSan runtime turns full path
to binary or shared library into its basename
(/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible
(when we obtained the full path from the symbolizer), we now do it as
late as possible (right before printing the error report).
This seems like a right thing to do - stripping to basename is a detail
of report formatting implementation, and should belong there. Also, we
might need the full path at some point - for example, to match the
suppressions.
llvm-svn: 221225
|
|
|
|
| |
llvm-svn: 221195
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change removes `__tsan::StackTrace` class. There are
now three alternatives:
# Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer
of PCs. It is used in functions that need stack traces in read-only
mode, and helps to prevent unnecessary allocations/copies (e.g.
for StackTraces fetched from StackDepot).
# `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in
a constant array. It is used in TraceHeader (non-Go version)
# `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically
allocated via TSan internal allocator.
Test Plan: compiler-rt test suite
Reviewers: dvyukov, kcc
Reviewed By: kcc
Subscribers: llvm-commits, kcc
Differential Revision: http://reviews.llvm.org/D6004
llvm-svn: 221194
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5993
llvm-svn: 220674
|
|
|
|
|
|
|
|
| |
completely initialized
Differential Revision: http://reviews.llvm.org/D5992
llvm-svn: 220673
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5990
llvm-svn: 220672
|
|
|
|
| |
llvm-svn: 220637
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
introduce a BufferedStackTrace class, which owns this array.
Summary:
This change splits __sanitizer::StackTrace class into a lightweight
__sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace,
which owns it. This would allow us to simplify the interface of StackDepot,
and eventually merge __sanitizer::StackTrace with __tsan::StackTrace.
Test Plan: regression test suite.
Reviewers: kcc, dvyukov
Reviewed By: dvyukov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5985
llvm-svn: 220635
|
|
|
|
|
|
|
|
|
| |
Allow user memory in the first TB of address space.
This also enabled non-pie binaries and freebsd.
Fixes issue:
https://code.google.com/p/thread-sanitizer/issues/detail?id=5
llvm-svn: 220571
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5858
llvm-svn: 220554
|
|
|
|
| |
llvm-svn: 220369
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5857
llvm-svn: 220292
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5856
llvm-svn: 220291
|
|
|
|
|
|
|
| |
Write interceptor calls malloc, which causes a false
unsafe-call-in-signal-handler report. See the test.
llvm-svn: 219784
|
|
|
|
| |
llvm-svn: 219779
|
|
|
|
| |
llvm-svn: 219678
|
|
|
|
|
|
|
|
|
|
| |
The current handling (manual execution of atexit callbacks)
is overly complex and leads to constant problems due to mutual ordering of callbacks.
Instead simply wrap callbacks into our wrapper to establish
the necessary synchronization.
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=80
llvm-svn: 219675
|
|
|
|
|
|
|
| |
Previously we said that it's a data race, which is confusing
if it happens in the same thread.
llvm-svn: 219600
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5708
llvm-svn: 219483
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D5663
llvm-svn: 219395
|