[libcxx] [clang] [llvm] [compiler-rt] [mlir] [asan] Enable StackSafetyAnalysis by default (PR #77210)

Zequan Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 09:35:47 PST 2024


ZequanWu wrote:

Heads up! This causes clang crash:
cmd:
```
clang++ "-cc1" "-triple" "x86_64-apple-macosx10.15.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-femit-dwarf-unwind=no-compact-unwind" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "glslang_lex_autogen.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-fmerge-all-constants" "-fno-delete-null-pointer-checks" "-mframe-pointer=all" "-relaxed-aliasing" "-ffp-contract=off" "-fno-rounding-math" "-funwind-tables=2" "-target-sdk-version=14.0" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-target-cpu" "penryn" "-tune-cpu" "generic" "-debug-info-kind=line-tables-only" "-dwarf-version=4" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/Volumes/Work/s/w/ir/cache/builder/src/out/Release" "-target-linker-version" "820.1" "-mllvm" "-crash-diagnostics-dir=../../tools/clang/crashreports" "-fcoverage-compilation-dir=/Volumes/Work/s/w/ir/cache/builder/src/out/Release" "-nostdinc++" "-D" "ANGLE_ENABLE_ESSL" "-D" "ANGLE_ENABLE_GLSL" "-D" "MEMORY_TOOL_REPLACES_ALLOCATOR" "-D" "ADDRESS_SANITIZER" "-D" "__STDC_CONSTANT_MACROS" "-D" "__STDC_FORMAT_MACROS" "-D" "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE" "-D" "CR_XCODE_VERSION=1500" "-D" "CR_CLANG_REVISION=\"llvmorg-18-init-16856-gd1ecd12f-0\"" "-D" "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS" "-D" "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS" "-D" "CR_LIBCXX_REVISION=e4aac3ace5ad6e3737740daee3afeaa9c9ab0360" "-D" "NDEBUG" "-D" "NVALGRIND" "-D" "DYNAMIC_ANNOTATIONS_ENABLED=0" "-D" "ANGLE_OUTSIDE_WEBKIT" "-D" "ANGLE_DELEGATE_WORKERS=1" "-D" "ANGLE_USE_ABSEIL" "-D" "ABSL_ALLOCATOR_NOTHROW=1" "-D" "__DATE__=" "-D" "__TIME__=" "-D" "__TIMESTAMP__=" "-O2" "-Wall" "-Wextra" "-Wimplicit-fallthrough" "-Wextra-semi" "-Wunreachable-code-aggressive" "-Wthread-safety" "-Wunguarded-availability" "-Wno-missing-field-initializers" "-Wno-unused-parameter" "-Wno-psabi" "-Wloop-analysis" "-Wno-unneeded-internal-declaration" "-Wenum-compare-conditional" "-Wno-ignored-pragma-optimize" "-Wno-deprecated-builtins" "-Wno-bitfield-constant-conversion" "-Wno-deprecated-this-capture" "-Wno-invalid-offsetof" "-Wno-vla-extension" "-Wno-thread-safety-reference-return" "-Wshadow" "-Wno-builtin-macro-redefined" "-Wheader-hygiene" "-Wstring-conversion" "-Wtautological-overlap-compare" "-Wexit-time-destructors" "-Wglobal-constructors" "-Wbad-function-cast" "-Wconditional-uninitialized" "-Wextra-semi-stmt" "-Wfloat-conversion" "-Winconsistent-missing-destructor-override" "-Wmissing-field-initializers" "-Wnewline-eof" "-Wnon-virtual-dtor" "-Wredundant-parens" "-Wreturn-std-move" "-Wshadow" "-Wshadow-field" "-Wtautological-type-limit-compare" "-Wundefined-reinterpret-cast" "-Wunneeded-internal-declaration" "-Wunused-but-set-variable" "-Wsuggest-destructor-override" "-Wsuggest-override" "-Wparentheses" "-Wrange-loop-analysis" "-Wstrict-prototypes" "-Wunreachable-code-aggressive" "-Wshorten-64-to-32" "-Wno-c++11-narrowing-const-reference" "-Wno-trigraphs" "-std=c++20" "-fdeprecated-macro" "-ferror-limit" "19" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-fsanitize=address" "-fno-sanitize-memory-param-retval" "-fsanitize-address-use-after-scope" "-fsanitize-address-globals-dead-stripping" "-fno-assume-sane-operator-new" "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fno-rtti" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fno-implicit-modules" "-fmax-type-align=16" "-Qn" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-mllvm" "-instcombine-lower-dbg-declare=0" "-mllvm" "-split-threshold-for-reg-with-hint=0" "-fcomplete-member-pointers" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++" "glslang_lex_autogen-7bfb0a.cpp"
```
Attached source code: [glslang_lex_autogen-7bfb0a.txt](https://github.com/llvm/llvm-project/files/13906543/glslang_lex_autogen-7bfb0a.txt) (Since it doesn't allow me to attach file ends with .cpp, I changed the suffix to .txt)


https://github.com/llvm/llvm-project/pull/77210


More information about the cfe-commits mailing list