-
Notifications
You must be signed in to change notification settings - Fork 1.7k
reenable msan sanitizer workflow #1589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Yup, i do not see where you custom-build libc++. That is really necessary for MSan.
|
something like https://github.com/google/benchmark/blob/main/.github/libcxx-setup.sh ? we used to have this, but with it the sanitizer workflow timed out because the libc++ build is way too slow. maybe it's worth trying just for msan. |
Close, but my snippet is the more modern version of that incantation.
Unless the whole LLVM gets built accidentally, i don't believe that should be slow at all, maybe 10 extra minutes. |
note: LLVM build is at 30% after 12m. |
msan debug failure is the same as when we didn't build libc++ with msan (unless i messed up the linking somehow) |
.github/libcxx-setup.sh
Outdated
#make -C llvm-build -j3 cxx cxxabi | ||
#sudo make -C llvm-build install-cxx install-cxxabi | ||
#cd .. | ||
cd ./llvm-project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd ./llvm-project/runtimes/
You have noticed that the libc++ build itself failed, right? |
gah, no i didn't. i guess the script should return an error status. |
# Checkout LLVM sources | ||
#git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project | ||
# | ||
git clone --depth=1 https://github.com/llvm/llvm-project.git llvm-project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing to note, it is rather issue-prone to use libc++ from trunk,
e.g. because nowadays they only guarantee building libc++ with clang
from the same revision or so, so building with older clang may fail,
and i'm not sure that will be caught at cmake time.
So it would be best to checkout some specific tag.
.github/libcxx-setup.sh
Outdated
-DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \ | ||
-DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \ | ||
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \ | ||
-S llvm -B llvm-build -G "Unix Makefiles" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, i guess it's -S .
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. working on it. can't test locally so i'm iterating here :(
ok it builds much faster (yay) but still fails with the same error in |
Nice! |
welp. msan passes, now asan is failing. it looks like an odr violation in libcxx so i tried suppression but failed. concerned that it is odr violation but coming from something in our code (the output tests maybe?) |
Could you try passing |
run: | | ||
"${GITHUB_WORKSPACE}/.github/libcxx-setup.sh" | ||
echo "EXTRA_CXX_FLAGS=\"-stdlib=libc++\"" >> $GITHUB_ENV | ||
echo "EXTRA_CXX_FLAGS=-stdlib=libc++ -L ${GITHUB_WORKSPACE}/llvm-build/lib -lc++abi -Isystem${GITHUB_WORKSPACE}/llvm-build/include -Isystem${GITHUB_WORKSPACE}/llvm-build/include/c++/v1 -Wl,-rpath,${GITHUB_WORKSPACE}/llvm-build/lib" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, last guess:
Prepend -nostdlibc++
before -stdlib=libc++
here.
.github/workflows/sanitizer.yml
Outdated
run: | | ||
"${GITHUB_WORKSPACE}/.github/libcxx-setup.sh" | ||
echo "EXTRA_CXX_FLAGS=\"-stdlib=libc++\"" >> $GITHUB_ENV | ||
echo "EXTRA_CXX_FLAGS=-nostdlibc++ -stdlib=libc++ -L ${GITHUB_WORKSPACE}/llvm-build/lib -lc++abi -Isystem${GITHUB_WORKSPACE}/llvm-build/include -Isystem${GITHUB_WORKSPACE}/llvm-build/include/c++/v1 -Wl,-rpath,${GITHUB_WORKSPACE}/llvm-build/lib" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err, i guess it's apparently -nostdlib++
, without the c
letter.
Also, are you sure about the space after -L
?
Ok, final guess: add |
@dmah42 sorry for so much back-n-forth here. |
no problem. I'm at a loss so I'm happy for guidance. |
|
.github/workflows/sanitizer.yml
Outdated
@@ -23,7 +23,7 @@ jobs: | |||
- name: configure msan env | |||
if: matrix.sanitizer == 'msan' | |||
run: | | |||
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins" >> $GITHUB_ENV | |||
echo "EXTRA_FLAGS=-g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-address-use-odr-indicator" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be for if: matrix.sanitizer == 'asan'
block, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh. i forgot what i was doing over the weekend. sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default for non-windows so i can drop it anyway
I see. Do we really need to custom-build libc++ for non-msan? Because that isn't really necessary. |
they're all passing in the current state.. maybe just don't use the custom libc++ for asan (as it seems to have the issue)? or find the way to suppress the warning correctly. |
That's what i'm suggesting, yes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, ship it! (probably should be squash-merged)
Thank you.
thanks for all the help! |
No description provided.