This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use libbacktrace as libsanitizer's symbolizer
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Evgeniy Stepanov <eugenis at google dot com>
- Cc: Alexey Samsonov <samsonov at google dot com>, Konstantin Serebryany <kcc at gcc dot gnu dot org>, Ian Lance Taylor <iant at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Nov 2013 12:21:54 +0100
- Subject: Re: [PATCH] Use libbacktrace as libsanitizer's symbolizer
- Authentication-results: sourceware.org; auth=none
- References: <CAGSYnCOs6BHEqfhoBdpF0AEODHhbhLENyWGy_DrObVnUv+js2g at mail dot gmail dot com> <20131118162342 dot GH892 at tucnak dot redhat dot com> <CAGSYnCPcGeYB7EEw=jAFf6h-gc2wJi0hqeZLDPEfmKOjq3FWAA at mail dot gmail dot com> <20131119153350 dot GW892 at tucnak dot redhat dot com> <20131119164221 dot GZ892 at tucnak dot redhat dot com> <CAGSYnCNYcAfhN6k-JFkBbnub2U6=x_VYCuH2K7VhSUf7HZ2FCQ at mail dot gmail dot com> <20131122183452 dot GI892 at tucnak dot redhat dot com> <CAGSYnCOqf4Yz0ji+tGnioAN1HF8iuHVLpq+sBRO9h6qYnwU=2A at mail dot gmail dot com> <20131125150203 dot GX892 at tucnak dot redhat dot com> <CAFKCwrhxcMBfm7NKkMRJ56VCnAjLDs+Z3CfL5=h6ZShh6hD8Qw at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 26, 2013 at 03:00:27PM +0400, Evgeniy Stepanov wrote:
> [plain text version]
>
> Tool-specific actions in the interceptors are disabled when we enter
> the symbolizer.
>
> What happens if user app links libbacktrace? An instrumented
> libbacktrace? Memory that is allocated internally in sanitizer runtime
Well, libbacktrace isn't an installed library, so it is unlikely they do.
Plus, we use shared libraries by default, and libbacktrace is then linked
directly into libasan.so.1 etc. Ideally we should use symbol versioning
to only export symbols we want to export and not others.
Given that libbacktrace is right now just a convenience library, supposedly
it might be worthwhile to build it with all symbols hidden, so that e.g.
libgo.so doesn't export the backtrace_* symbols.
Or, of course, if libsanitizer chooses not to use the convenience libraries
as is, but instead have in Makefile.am rules to compile (a subset of)
libbacktrace source files directly in libsanitizer/sanitizer_common, then
the symbols could be __sanitizer_backtrace_* rather than backtrace_*, thus no
chance of anybody overloading it, plus we could then just write another
implementation of libbacktrace/{alloc,mmap}.c using sanitizer_common's
allocator instead of the mmap using allocator libbacktrace has.
Then there would be no possibility (otherwise just low) somebody would
override it mistakenly with instrumented version thereof.
Jakub