Skip to content
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

MDBF-793 - Retire MSAN clang-15 builder, upgrade to clang-19 #562

Open
wants to merge 50 commits into
base: dev
Choose a base branch
from

Conversation

RazvanLiviuVarzaru
Copy link
Collaborator

@RazvanLiviuVarzaru RazvanLiviuVarzaru commented Sep 12, 2024

Replace MSAN CLANG-15 builder with CLANG 19 on Debian 12.

@RazvanLiviuVarzaru RazvanLiviuVarzaru marked this pull request as ready for review September 12, 2024 12:46
@RazvanLiviuVarzaru
Copy link
Collaborator Author

@grooverdan
I think this closes #482.

RazvanLiviuVarzaru and others added 23 commits November 28, 2024 15:25
- replace debian 11 - clang 15 with debian 12 - clang 19

For msan.Dockerfile
 - starting from clang 18 libunwing is added to ENABLE_RUNTIMES
 - make the dockerfile work for both bookworm / bullseye editions (LLVM repository)
 - doc Makefile is not present in bookworm for gmp
 - bookworm has newer aclocal / automake -> cracklib2 fix
 - clang 19 needs libclang-19-dev and libllvmlibc-19-dev installed
This is to aid consumption by developers
and have a ready available MSAN container.

Technically we don't need to purge from image
as its a build stage, but we do to keep size a bit smaller.
Also use update-alternatives to provide clang/clang++ links.

With a 6 monthly new release cycle of clang. Keeping it such
that a rebuild of image is sufficient to re-deploy rather than
a master restart will facilitate more frequent updates and
a fixed builder url.
Requested by Marko to make this a more realistic test
of the codebase delivered to users.

No -DWITH_DBUG_TRACE=OFF exists in RelWithDebInfo mode
make clang/clang++ alternates as soon as installed
Unit tests run all ok.

WITH_SAFE_MALLOC=OFF is default in RelWithDebInfo mode.
Also convient CFLAGS and MSAN environment
variables.
to non-instrumented things.

Otherwise these sorts of error in testing:

 LD_LIBRARY_PATH=/msan-libs/ /usr/bin/ctest
/usr/bin/ctest: symbol lookup error: /msan-libs/libgmp.so.10: undefined symbol: __msan_va_arg_overflow_size_tls
And the --force is for debian:11 compat where the files exist in the tarball.
Didn't instrument sufficiently.

MSAN errors resultin the form:

==9000==WARNING: MemorySanitizer: use-of-uninitialized-value
[Detaching after fork from child process 9003]
    #0 0x55c87cbda03f in my_base64_encode /source/mysys/base64.c:113:13
    #1 0x55c87af96efb in calculate_server_uid(char*) /source/sql/mysqld.cc:9889:3
    #2 0x55c87af96efb in init_common_variables() /source/sql/mysqld.cc:3882:7
    #3 0x55c87af9111e in mysqld_main(int, char**) /source/sql/mysqld.cc:5546:7
    #4 0x7f6d94ab5249  (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    #5 0x7f6d94ab5304 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27304) (BuildId: c047672cae7964324658491e7dee26748ae5d2f8)
    #6 0x55c87aeef130 in _start (/build/sql/mariadbd+0x6ee130) (BuildId: abe0c6d0a0f0bdcee26c5e1f69353335cca3bd8a)

The sha1 has that is being encoded wasn't maked as initialized though
the openssl libs wrote the hash there.
Weird permission issue apt-sourcing the snapshot llvm
about _apt user not having access to root files
(and fix cracklib to build).
It has been corrected upstream cracklib/cracklib@bdb3aee
but in this case the Debug function is a no-op so no harm done.
Saw debian having 11.0.2 in experimental which once it reaches sid
will be possible to revert this change.
trying to resolve large stacks in msan itself.
…braries

This was in Marko's original script.
@grooverdan grooverdan force-pushed the feature/msan-clang-19 branch from fe47a5e to 54b43e1 Compare November 28, 2024 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants