Commit Graph

1000 Commits

Author SHA1 Message Date
Alexey Samsonov 33a2cc1e10 Fix gen_dynamic_list.py for Python 3. Patch by Marcoen Hirschberg.
llvm-svn: 197493
2013-12-17 12:19:16 +00:00
Alexey Samsonov 25d010a98d [Sanitizer] Always initialize a Symbolizer (even if 'symbolize' is false).
If 'symbolize' flag is not set, we still want to transform virtual address
to module+offset pair in the call to Symbolizer::SymbolizeCode().
See https://code.google.com/p/address-sanitizer/issues/detail?id=251 for
more details.

llvm-svn: 197491
2013-12-17 11:15:39 +00:00
Evgeniy Stepanov 59bb0878e2 [msan] Tweak gethostbyname_r interceptor some more.
This is covered by msan_test depending on glibc version and/or resolver setup.

llvm-svn: 197484
2013-12-17 09:13:54 +00:00
Evgeniy Stepanov 43fc44007d [msan] Fix gethostbyname_r and similar interceptors.
*h_errno is written not on success, but on failure.
In fact, it seems like it can be written even when return value signals
success, so we just unpoison it in all cases.

llvm-svn: 197383
2013-12-16 13:24:33 +00:00
Kostya Serebryany 57bfdb080b [asan] add flag uar_noreserve to use noreserve mmap for fake stack. uar_noreserve=1 will save some memory but also negatively affect performance
llvm-svn: 197233
2013-12-13 15:03:49 +00:00
Evgeniy Stepanov a643a754be [sanitizer] Disable call wrapping when building for Go.
llvm-svn: 197232
2013-12-13 14:58:21 +00:00
Evgeniy Stepanov 879c552dd9 [msan] Wrap indirect calls from sanitizer rtl when running under DR.
llvm-svn: 197226
2013-12-13 13:13:46 +00:00
Timur Iskhodzhanov 89a346c2a1 [ASan] Fix StackTrace::SlowUnwindStack on Windows
llvm-svn: 196894
2013-12-10 08:30:39 +00:00
Chandler Carruth 3f697191bb Revert a final patch that was committed without the author contributing
it to the LLVM project through the appropriate channels.

This reverts:
r195837: "[Sanitizer] Add rudimentary support for using libbacktrace in ..."

llvm-svn: 196875
2013-12-10 04:40:39 +00:00
Richard Smith ab788cdc81 Unbreak build by adding an implementation of PopStackFrames function.
llvm-svn: 196809
2013-12-09 19:52:39 +00:00
Chandler Carruth 736f9fd229 Revert three patches which were committed without explicit contribution
by their authors.

This may break builds where others added code relying on these patches,
but please *do not* revert this commit. Instead, we will prepare patches
which fix the failures.

Reverts the following commits:
r168306: "[asan] support x32 mode in the fast stack unwinder. Patch by H.J. Lu"
r168356: "[asan] more support for powerpc, patch by Peter Bergner"
r196489: "[sanitizer] fix the ppc32 build (patch by Jakub Jelinek)"

llvm-svn: 196802
2013-12-09 19:25:51 +00:00
Alexey Samsonov 9f6218bf44 PR17977: don't assume EOWNERDEAD is always defined
Summary: See details in http://llvm.org/bugs/show_bug.cgi?id=17977

Reviewers: dvyukov

Reviewed By: dvyukov

CC: glider, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2340

llvm-svn: 196779
2013-12-09 13:21:43 +00:00
Sergey Matveev 9be70fbda9 [sanitizer] Introduce VReport and VPrintf macros and use them in sanitizer code.
Instead of "if (common_flags()->verbosity) Report(...)" we now have macros.

llvm-svn: 196497
2013-12-05 12:04:51 +00:00
Kostya Serebryany f2c93b2973 [sanitizer] fix the ppc32 build (patch by Jakub Jelinek)
llvm-svn: 196489
2013-12-05 08:51:48 +00:00
Kostya Serebryany 14e92c2c62 [sanitizer] support toolchains that don't understand CFI directives
Summary: Support toolchains that don't understand CFI directives.

Reviewers: dvyukov

Reviewed By: dvyukov

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2336

llvm-svn: 196480
2013-12-05 07:44:35 +00:00
Sergey Matveev 7bc300c8fc [sanitizer] Fix log_path behavior with StopTheWorld.
Summary:
Fix race on report_fd/report_fd_pid between the parent process and the
tracer task.

Reviewers: samsonov

Reviewed By: samsonov

CC: llvm-commits, kcc, dvyukov

Differential Revision: http://llvm-reviews.chandlerc.com/D2306

llvm-svn: 196385
2013-12-04 14:37:01 +00:00
Alexey Samsonov 907eb5b630 [Sanitizer] Use more appropriate InternalScopedString in GetCodeRangeForFile
llvm-svn: 196264
2013-12-03 09:29:23 +00:00
Alexey Samsonov 8dd33a27c3 [Sanitizer] Fix a bug introduced in r196112. Add a test.
llvm-svn: 196263
2013-12-03 09:21:08 +00:00
Sergey Matveev b748d46019 [sanitizer] Allow InternalMmapVector construction with zero capacity.
llvm-svn: 196112
2013-12-02 15:41:04 +00:00
Evgeniy Stepanov c0378e72d1 [sanitizer] Intercept textdomain.
Patch by Alexander Taran.

llvm-svn: 196098
2013-12-02 13:43:26 +00:00
Kostya Serebryany 5774faf5b0 [sanitizer] disable shmctl intercetor in 32-bit -- it is rotten (bug filed)
llvm-svn: 195958
2013-11-29 14:09:13 +00:00
Timur Iskhodzhanov 5ca41e3800 Increase the LocatePcInTrace PC threshold now that GET_STACK_TRACE_WITH_PC_AND_BP has grown
llvm-svn: 195957
2013-11-29 13:15:25 +00:00
Timur Iskhodzhanov bbf2ff8193 [ASan] Also print <empty stack> when size==0
llvm-svn: 195955
2013-11-29 12:08:59 +00:00
Evgeniy Stepanov f2cddc3e64 [sanitizer] Disable iconv interceptor in OSX.
iconv is defined in an optional DSO, and our interception logic on OSX does not
support that.

llvm-svn: 195919
2013-11-28 14:42:59 +00:00
Evgeniy Stepanov b56c5cd95e [sanitizer] Intercept times.
llvm-svn: 195918
2013-11-28 14:41:22 +00:00
Evgeniy Stepanov 9c1f8323ae [sanitizer] Intercept iconv.
llvm-svn: 195917
2013-11-28 14:14:48 +00:00
Dmitry Vyukov 8d1eb705c7 tsan: add support for passing file descriptors over UNIX domain sockets
tsan was missing new fd's arrived from recvmsg(),
and thus was reporting false positives due to missed synchronization on the fd's

llvm-svn: 195914
2013-11-28 09:09:42 +00:00
Evgeniy Stepanov b76b687628 [sanitizer] Intercept __xpg_strerror_r.
llvm-svn: 195839
2013-11-27 12:29:10 +00:00
Alexey Samsonov 1c256cbcc4 [Sanitizer] Add rudimentary support for using libbacktrace in symbolizer.
More steps are needed to actually make it usable:
* sanitizer runtimes should be compiled with -DSANITIZER_LIBBACKTRACE.
* libbacktrace headers should be installed.
* user has to manually link in libbacktrace.a into the executable.

We can easily solve the first two problems in the build system, but
detecting/linking libbacktrace to all the tests we have and end-user programs
is more challenging (and will unlikely work w/o Driver support).

Based on the patch by Jakub Jelinek!

llvm-svn: 195837
2013-11-27 11:46:58 +00:00
Dmitry Vyukov 44be414d69 asan: fix android build
android does not seem to have IOCB_CMD_PREADV

llvm-svn: 195835
2013-11-27 11:20:55 +00:00
Dmitry Vyukov 51b35901fd tsan: minor refactoring
use common helper macro

llvm-svn: 195832
2013-11-27 09:59:11 +00:00
Dmitry Vyukov 7bd319cc08 tsan: fix flags parsing
- running_on_valgrind was not parsed in some contexts
- refactor code a bit
- add comprehensive tests for flags parsing

llvm-svn: 195831
2013-11-27 09:54:10 +00:00
Dmitry Vyukov ee882ba4a1 tsan: support synchronization by means of linux aio
http://llvm-reviews.chandlerc.com/D2269

llvm-svn: 195830
2013-11-27 09:10:47 +00:00
Alexey Samsonov d5144879f9 [Sanitizer] Improve external symbolizer behavior.
1) Don't start external symbolizer subprocess until we actually try to
   symbolize anything.
2) Allow to turn off external symbolizer by providing empty ?SAN_SYMBOLIZER_PATH
   environment variable.

llvm-svn: 195771
2013-11-26 16:24:53 +00:00
Lorenzo Martignoni 895454e1e4 Implement a bunch of custom glibc wrappers & corresponding tests
llvm-svn: 195749
2013-11-26 11:45:58 +00:00
Timur Iskhodzhanov 895392d03f [ASan] Use ExitProcess rather than _exit on Windows to avoid calling global dtors etc
llvm-svn: 195723
2013-11-26 09:40:39 +00:00
Kostya Serebryany ccfc0481f1 [sanitizer] Implement TwoLevelByteMap and use it for the internal allocator on 64-bit.
Summary:
Implement TwoLevelByteMap and use it for the internal allocator on 64-bit.
This reduces bss on 64-bit by ~8Mb because we don't use FlatByteMap on 64-bits any more.

Dmitry, please check my understanding of atomics.

Reviewers: dvyukov

Reviewed By: dvyukov

CC: samsonov, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2259

llvm-svn: 195637
2013-11-25 11:33:41 +00:00
Timur Iskhodzhanov 0d419293e2 [ASan] Follow-up fix: use #if SANITIZER_WINDOWS, not #ifdef
llvm-svn: 195625
2013-11-25 07:56:05 +00:00
Timur Iskhodzhanov 25cc3c55cc [ASan] Un-break the Windows build
llvm-svn: 195624
2013-11-25 07:54:55 +00:00
Sergey Matveev 634a75b63e [sanitizer] Do not clear memory which comes from secondary allocator.
Secondary allocator is mmap-based, so the memory is already zeroed.

llvm-svn: 195571
2013-11-24 14:45:38 +00:00
Kostya Serebryany a2fde9484f [sanitizer] use 16-byte aligned bzero in performance critical place (mostly for lsan)
llvm-svn: 195549
2013-11-23 12:49:19 +00:00
Evgeniy Stepanov 8f944b6672 [sanitizer] Fix kernel headers compatibility on powerpc64.
llvm-svn: 195442
2013-11-22 11:01:43 +00:00
Kostya Serebryany b1118e5952 Call real pthread_attr_getstack instead of the interceptor
Summary:
Call real pthread_attr_getstack instead of the interceptor
when we do intercept pthread_attr_getstack.

Reviewers: samsonov, eugenis

Reviewed By: samsonov

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2237

llvm-svn: 195441
2013-11-22 10:44:31 +00:00
Evgeniy Stepanov db643d7678 [sanitizer] Add kernel_stat definitions for arm.
llvm-svn: 195436
2013-11-22 10:09:34 +00:00
Evgeniy Stepanov f3aa5b5257 [sanitizer] Restore perf_event_attr handling.
This time in a forward/backward compatible way.

llvm-svn: 195434
2013-11-22 09:32:39 +00:00
Evgeniy Stepanov c53407de3c [sanitizer] Fix build.
llvm-svn: 195433
2013-11-22 09:26:10 +00:00
Evgeniy Stepanov 39cc337e20 [sanitizer] Change the way we use certain linux kernel headers.
Some linux headers are broken on older kernels.
Instead of depending on the constants and types from such headers directly,
we provide our own definitions and then verify them with compile-time
assertions. This makes the dependency on the headers test-only and would allow
switching to some other way of testing on older kernels, or even disable the
tests as the last resort (after all, kernel interfaces are supposed to be
stable).

llvm-svn: 195427
2013-11-22 09:01:50 +00:00
Evgeniy Stepanov fe8ed4a591 [sanitizer] Add missing header dependencies.
llvm-svn: 195425
2013-11-22 08:55:33 +00:00
Peter Collingbourne f09d5d03fd Revert r195381, "Implement a bunch of custom glibc wrappers & corresponding tests."
It broke a buildbot.

llvm-svn: 195392
2013-11-21 23:48:19 +00:00
Peter Collingbourne 0a14a71061 Implement a bunch of custom glibc wrappers & corresponding tests.
- Introduce several new custom glibc wrappers
- Implement some of the not yet implemented wrappers
- Refactor and extend the tests
- Add script to make sure all declare custom glibc wrappers are implemented & tested.

Patch by Lorenzo Martignoni!

Differential Revision: http://llvm-reviews.chandlerc.com/D2234

llvm-svn: 195381
2013-11-21 23:18:03 +00:00