[llvm] [Instrumentation] Fix EdgeCounts vector size in SetBranchWeights (PR #99064)

Avi Kivity via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 02:29:05 PDT 2024


avikivity wrote:

Did you build clang with asan or -fstack-protector-all? without them the rogue write isn't caught.

This snippet reproduces it with Fedora 40's build (which has -fstack-protector-all enabled). Replace podman with docker if needed. You'll need rpc-195796.cpp and merged.profdata in the same directory.

```sh
podman run -i -v $PWD:$PWD -w $PWD docker.io/fedora:40 <<EOF
dnf -y install clang
 "/usr/bin/clang++" "-cc1" "-triple" "x86_64-redhat-linux-gnu" "-emit-llvm-bc" "-flto=thin" "-flto-unit" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "rpc.cc" "-mrelocation-model" "static" "-mframe-pointer=none" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "westmere" "-debug-info-kind=constructor" "-dwarf-version=5" "-debugger-tuning=gdb" "--compress-debug-sections=zlib" "-fdebug-compilation-dir=/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto" "-fdebug-prefix-map=/home/avi/scylla-maint=." "-fprofile-instrument=csllvm" "-fprofile-instrument-path=/home/avi/scylla-maint/build/release-cs-pgo/default_%m.profraw" "-fprofile-instrument-use-path=merged.profdata" "-fcoverage-compilation-dir=/home/avi/scylla-maint/build/release-cs-pgo/seastar.lto" "-sys-header-deps" "-D" "FMT_SHARED" "-D" "SEASTAR_API_LEVEL=7" "-D" "SEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT" "-D" "SEASTAR_HAS_MEMBARRIER" "-D" "SEASTAR_HAVE_ASAN_FIBER_SUPPORT" "-D" "SEASTAR_HAVE_HWLOC" "-D" "SEASTAR_HAVE_NUMA" "-D" "SEASTAR_HAVE_SYSTEMTAP_SDT" "-D" "SEASTAR_LOGGER_COMPILE_TIME_FMT" "-D" "SEASTAR_LOGGER_TYPE_STDOUT" "-D" "SEASTAR_PTHREAD_ATTR_SETAFFINITY_NP" "-D" "SEASTAR_SCHEDULING_GROUPS_COUNT=18" "-D" "SEASTAR_SSTRING" "-D" "SEASTAR_STRERROR_R_CHAR_P" "-D" "NDEBUG" "-U" "_FORTIFY_SOURCE" "-U" "NDEBUG" "-fmacro-prefix-map=/home/avi/scylla-maint=." "-fcoverage-prefix-map=/home/avi/scylla-maint=." "-O2"  "-Wno-backend-plugin"  "-std=gnu++23" "-fdeprecated-macro" "-ferror-limit" "19" "-fvisibility=hidden" "-fgnuc-version=4.2.1" "-fno-implicit-modules" "-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-mllvm" "-pgso=false" "-mllvm" "-enable-value-profiling=false" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++" "rpc-195796.cpp"
EOF
```

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


More information about the llvm-commits mailing list