https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66524
Bug ID: 66524 Summary: Unable to detect InitializationOrderFiasco when compiled with "g++ -fsanitize=address" Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: bhupendra_thosare at persistent dot co.in CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- I am trying to run sample program provided in following link using g++ (4.8.2) to report "initialization-order-fiasco" error. https://code.google.com/p/address-sanitizer/wiki/InitializationOrderFiasco However, if we are using g++ it do not report any error for following commands: ASAN_OPTIONS=check_initialization_order=true ./a.out export ASAN_OPTIONS=check_initialization_order=1; ./a.out a.out // It will not work as AddressSanitizer can optionally detect dynamic initialization order problems. We are using following script to build and run the sample program: ================================================================== # For gcc to print line numbers export ASAN_OPTIONS=symbolize=1 export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer #export ASAN_OPTIONS=check_initialization_order=1 # NOT WORKING :-/ flags="-fno-omit-frame-pointer -fno-common" echo "+++++++++++++++++++++++++++++++++++++++++" echo "++++ Loose init-order checking" echo "+++++++++++++++++++++++++++++++++++++++++" rm -f a.out g++ -fsanitize=address $flags -g a.cc b.cc echo "**** ASAN_OPTIONS=check_initialization_order=true ./a.out ****" ASAN_OPTIONS=check_initialization_order=true ./a.out ================================================================== If we use "clang++" instead of "g++" in above script then it reports "initialization-order-fiasco" error for same sample program. Please let us know if I am missing any step OR "ASAN_OPTIONS=check_initialization_order" is not supported for gcc 4.8.2.