This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [asan] Handle noreturn calls with __asan_handle_no_return ()


On Wed, Dec 5, 2012 at 7:43 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> On Wed, Dec 05, 2012 at 04:06:51PM +0100, Jakub Jelinek wrote:
>> FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_GlobalStringConstTest Ident(p[15]) execution test
>
> So, this one fails because we don't instrument string literals, in GCC
> they aren't anything close to global variables (like they are in LLVM?)

In LLVM, string literals are just regular constant global arrays of chars.
And global overflows in such literals are remarkably frequent, so it's
a good idea to implement this.

> Perhaps we could, handle STRING_CSTs in categorize_decl_for_section
> like flag_mudflap handles them (essentially disable -fmerge-constants),
> add code to output_constant_def_contents to emit the padding around it
> if protected and in asan_finish_file traverse constant_pool_htab (),
> looking for STRING_CSTs that were TREE_ASM_WRITTEN.
>
>> FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_FileNameInGlobalReportTest Ident(p[15]) output pattern test, should match zoo.*asan_test.cc
>
> This one fails to match because the filename in that case isn't
> asan_test.cc, but asan_test.C.  Can it use say
> ASAN_TEST_NAME macro,
> #ifndef ASAN_TEST_NAME
> # define ASAN_TEST_NAME "asan_test.cc"
> #endif
>
> and replace "zoo.*asan_test.cc" with "zoo.*" ASAN_TEST_NAME (and similarly
> in one of the disabled tests)?  Then asan_test.C could just
> #define ASAN_TEST_NAME "asan_test.C"
> before #include "asan_test.cc"

I'd rather replace it with a regexp asan_test.{cc,C} or even simpler,
drop the extension. Ok?

--kcc

>
>         Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]