public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Libsanitizer merge from upstream r249633.
@ 2015-10-13 11:14 Maxim Ostapenko
  2015-10-13 11:16 ` [PATCH 2/7] " Maxim Ostapenko
                   ` (7 more replies)
  0 siblings, 8 replies; 43+ messages in thread
From: Maxim Ostapenko @ 2015-10-13 11:14 UTC (permalink / raw)
  To: GCC Patches, Jakub Jelinek, Kostya Serebryany
  Cc: Dmitry Vyukov, Marek Polacek, Yury Gribov, Slava Garbuzov,
	Vyacheslav Barinov

Hi,

it's been a while since the last libsanitizer merge from upstream into 
GCC happened and the library has significantly changed since that time. 
The main features to be ported are:

-New common strings interceptors were added.
-Various allocator improvements were performed.
-Improvements for ASan deactivated start were performed.
-TSan and LSan were enabled for Aarch64.
-Fast unwinding was enabled for Aarch64.
-New tsan_unaligned_{load, store}_[n] functions were intoduced.
-asan_stack_malloc_[n] doesn't take a local stack as a second parameter 
anymore.
-sanitization for std containers is supported now.
-New interface functions for dynamic allocas and VLA's 
poisoning/unpoisoning were introduced.

Some features are not ported for now, by might be enabled in future:

-Embedded UBSan runtime into ASan and TSan ones. I don't enable this 
now, because of errors during ASan static linkage: GCC uses 
-whole-archive option that would lead to undefined references to C++ stuff.
-UBSan data descriptors for float-cast conversion support location 
propagation now. But sometimes we have loc == UNKNOWN_LOCATION in 
ubsan_instrument_float_cast, so use old ABI for now. See below for details.

The first patch of the series is the merge itself.

The second one introduces corresponding compiler changes.

Other patches are applied to library and they are GCC-specific:

Patches 3 and 4 are just reapplied David's and Jakub's patches for SPARC 
and disabling ODR violation detection respectively.

Patch 5 removes UBSan stubs from ASan and TSan code since we don't 
support embedded UBSan runtime into ASan and TSan.

Patch 6 changes heuristic for extracting last PC from stack frame for 
ARM in fast unwind routine. More details can be found here 
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61771).

Patch 7 forces libsanitizer to use an old ABI for ubsan float cast data 
descriptors, because sometimes we can have loc == UNKNOWN_LOCATION in 
ubsan_instrument_float_cast e.g. in a such case:

......
volatile double foo; // ubsan_instrument_float_cast is called by convert 
function.
......

Since foo is a tcc_declaration, loc is UNKNOWN_LOCATION. I'm actually 
not sure about this, perhaps we can fix this in GCC somehow.

I've regtested and {A, UB}San bootstrapped these patches on 
x86-64-unknown-linux-gnu and aarch64-linux-gnueabi (Juno board, 39 bit 
VA space) and tested for ARM under QEMU-ARM.
Testing ASan under QEMU-AARCH64 revealed many test failures due to LSan 
was enabled. In particular, it tries to call internal_clone function in 
LSan internals, that in turn calls _NR_clone syscall and than QEMU exits 
with EINTR error code (that might be expected, AFAIK QEMU is not very 
good with threads). So, I wonder, if I should disable LSan for AArch64 now?

I'm also asking community to help me with testing these patches on 
various targets (ARM, PPC, etc) I'm lack of, so could you help me on 
this please?

-Maxim

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2015-10-19  7:22 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 11:14 [PATCH 0/7] Libsanitizer merge from upstream r249633 Maxim Ostapenko
2015-10-13 11:16 ` [PATCH 2/7] " Maxim Ostapenko
2015-10-14  7:30   ` Jakub Jelinek
2015-10-15 10:34     ` Maxim Ostapenko
2015-10-19  7:28       ` Jakub Jelinek
2015-10-14  7:49   ` Yury Gribov
2015-10-13 11:18 ` [PATCH 4/7] " Maxim Ostapenko
2015-10-14  7:31   ` Jakub Jelinek
2015-10-13 11:18 ` [PATCH 3/7] " Maxim Ostapenko
2015-10-14  7:31   ` Jakub Jelinek
2015-10-13 11:20 ` [PATCH 5/7] " Maxim Ostapenko
2015-10-14  7:37   ` Jakub Jelinek
2015-10-14 16:23     ` Maxim Ostapenko
2015-10-13 11:21 ` [PATCH 6/7] " Maxim Ostapenko
2015-10-14  7:38   ` Jakub Jelinek
2015-10-13 11:22 ` [PATCH 7/7] " Maxim Ostapenko
2015-10-14  7:48   ` Jakub Jelinek
2015-10-14 10:52     ` Maxim Ostapenko
2015-10-14 11:06       ` Jakub Jelinek
2015-10-14 12:02         ` Maxim Ostapenko
2015-10-14 12:12           ` Jakub Jelinek
2015-10-16 11:34             ` Maxim Ostapenko
2015-10-19  7:22               ` Jakub Jelinek
     [not found] ` <561CE7BA.5070805@partner.samsung.com>
2015-10-13 16:54   ` [PATCH 1/7] " Maxim Ostapenko
2015-10-14  7:54     ` Jakub Jelinek
2015-10-14  9:34       ` Maxim Ostapenko
2015-10-14  9:46         ` Yury Gribov
2015-10-14 16:25         ` Maxim Ostapenko
2015-10-14 18:03       ` Adhemerval Zanella
2015-10-14 18:22         ` Evgenii Stepanov
2015-10-14 18:38           ` Renato Golin
2015-10-14 19:00             ` Andrew Pinski
2015-10-14 19:15               ` Renato Golin
2015-10-14 19:17                 ` Andrew Pinski
2015-10-15  7:55                   ` Ramana Radhakrishnan
2015-10-15  7:29                 ` Yury Gribov
2015-10-15  8:42                   ` Renato Golin
2015-10-15  9:21                     ` pinskia
2015-10-15  9:44                       ` Renato Golin
2015-10-16 13:50             ` Renato Golin
2015-10-16 14:06               ` Maxim Ostapenko
2015-10-16 14:12                 ` Renato Golin
2015-10-13 17:03 ` [PATCH 0/7] " Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).