This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Revert libsanitizer patches or fix 59009
- From: Kostya Serebryany <kcc at google dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, Evgeniy Stepanov <eugeni dot stepanov at gmail dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Jack Howarth <howarth at bromo dot med dot uc dot edu>, Alexander Potapenko <glider at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Dodji Seketeli <dodji at redhat dot com>, Dmitry Vyukov <dvyukov at google dot com>
- Date: Wed, 13 Nov 2013 10:45:54 +0400
- Subject: Re: Revert libsanitizer patches or fix 59009
- Authentication-results: sourceware.org; auth=none
- References: <20131112173725 dot GA24313 at ibm-tiger dot the-meissners dot org> <CAN=P9pgrW30Xnv0DsmkQNY72uyzwEQaWUAthaHYwuq3=Giz_Tw at mail dot gmail dot com> <CAN=P9pjSZcDNN3sP6fxJ4V553mQPQihpsuWiCpDLUrw=gszMGg at mail dot gmail dot com> <CAN=P9pjkzWkV_rQmcde-DKS8dg8xUjt+pyCUe_8yGMeCrBeRqQ at mail dot gmail dot com> <20131112180403 dot GA30956 at ibm-tiger dot the-meissners dot org> <CAN=P9pgPY-QcGMbm6k25fGS24qcTLXbZX8px+09n-oeG6O5ZzQ at mail dot gmail dot com> <20131112185704 dot GY27813 at tucnak dot zalov dot cz> <CAN=P9pibOvxQyDZzQimGafSZEfemWXXdN=afWJWk17a30Vt-ig at mail dot gmail dot com> <20131112193015 dot GZ27813 at tucnak dot zalov dot cz> <20131112234704 dot GF27813 at tucnak dot zalov dot cz> <20131112234926 dot GG27813 at tucnak dot zalov dot cz>
Many thanks, Jakub.
I don't want to appear in this situation again.
Would you suggest a place to create a wiki page which would list all
required steps to test libsanitizer?
libsanitizer is (unfortunately) a very system-dependent beast and our
upstream commits will break other platforms regularly;
that's unavoidable unless each platform's community helps us test the
code upstream. (I.e. I encourage PowerPC folks to help us in the LLVM
land)
For gcc merges, all we can promise to do is to run any amount of
testing (described on a to-be-created wiki) on an x86_64 linux
machine.
For other kinds of testing we'll rely on the platform owners.
If we break someone's platform, we expect the owners to send us
patches which we can commit upstream. That's what happened with x32
last week.
If the platform owners don't care about libsanitizer and don't want to
help us fix it -- we better simply disable libsanitizer on those
platforms to save everyone's time.
--kcc
On Wed, Nov 13, 2013 at 3:49 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Nov 13, 2013 at 12:47:04AM +0100, Jakub Jelinek wrote:
>> On Tue, Nov 12, 2013 at 08:30:15PM +0100, Jakub Jelinek wrote:
>> > Anyway, the following #ifdefs out tons of dead code and still builds just
>> > fine, the only difference is that those symbols nothing really uses from
>> > libasan/libtsan are no longer exported, but nothing else changes.
>>
>> Actually, ifdefing out the *limits_posix.cc file didn't work well, because
>> the ioctl wrapping isn't dead, so I'm afraid we are back to including
>> sys/vt.h again. But, at least for now the dead syscall interception
>> is #ifdefed out. Tested on x86_64-linux, committed to trunk.
>>
>> > I guess the #if 0 can be replaced by some #ifdef with some nice name or
>> > something.
>> >
>> > BTW, the 10MB .bss in libubsan is really insane, while perhaps users are
>> > expecting to have huge overhead with libasan or libtsan, for libubsan it
>> > looks way too big. Why do you need it?
>>
>> Seems the allocator is brought in through a chain of *.o files from
>> sanitizer_common, libubsan wants the backtrace stuff, but I'd hope if it
>> needs an allocator for that, it doesn't need one backed by 10MB .bss buffer,
>> some fairly minimal would be much better for that.
>
> Oops, now with the patch.
>
> 2013-11-12 Jakub Jelinek <jakub@redhat.com>
>
> * sanitizer_common/sanitizer_platform_limits_linux.cc: Temporarily
> ifdef out almost the whole source.
> * sanitizer_common/sanitizer_common_syscalls.inc: Likewise.
>
> --- libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc.jj 2013-11-12 20:19:46.936825637 +0100
> +++ libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc 2013-11-12 23:12:14.531418217 +0100
> @@ -14,6 +14,7 @@
> // userspace headers.
> // Most "normal" includes go in sanitizer_platform_limits_posix.cc
>
> +#ifdef SYSCALL_INTERCEPTION
> #include "sanitizer_platform.h"
> #if SANITIZER_LINUX
>
> @@ -43,3 +44,4 @@ namespace __sanitizer {
> } // namespace __sanitizer
>
> #endif // SANITIZER_LINUX
> +#endif
> --- libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc.jj 2013-11-12 20:19:46.945825141 +0100
> +++ libsanitizer/sanitizer_common/sanitizer_common_syscalls.inc 2013-11-12 23:12:14.533417997 +0100
> @@ -58,6 +58,8 @@
> # define COMMON_SYSCALL_POST_FORK(res)
> #endif
>
> +#ifdef SYSCALL_INTERCEPTION
> +
> // FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such).
>
> extern "C" {
> @@ -2722,6 +2724,8 @@ POST_SYSCALL(vfork)(long res) {
> }
> } // extern "C"
>
> +#endif
> +
> #undef PRE_SYSCALL
> #undef PRE_READ
> #undef PRE_WRITE
>
>
> Jakub