https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79061

            Bug ID: 79061
           Summary: [7 Regression][LTO][ASAN] LTO plus ASAN fails with
                    "AddressSanitizer: initialization-order-fiasco"
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Created attachment 40504
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40504&action=edit
Test case: untar (creates test/ subdir) and run "make" (or "g++ -g -O0 -flto
-fsanitize=address *.cc && ./a.out")

The attached test case (tar ball) consists of 5 .h/.cc files with 50 LoC in
total (also counting #if def and empty lines).


Running "make" fails with:

rm -f a.out
g++ -g -O0 -flto -fsanitize=address xptimer.cc xptiming.cc test.cc
./a.out
=================================================================
==13105==ERROR: AddressSanitizer: initialization-order-fiasco on address
0x000000601540 at pc 0x000000400a66 bp 0x7ffc758b0b40 sp 0x7ffc758b0b38


Works without LTO or with GCC 6 - and I believe there is no init order problem
in the attached code.

Reply via email to