Skip to content

Commit 4f904a1

Browse files
committed
msan: update motd message for developer use
1 parent 5abcd82 commit 4f904a1

3 files changed

Lines changed: 52 additions & 45 deletions

File tree

.github/workflows/build-debian.msan-based.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- 'ci_build_images/rr.Dockerfile'
1111
- 'ci_build_images/msan.fragment.Dockerfile'
1212
- 'ci_build_images/msan.instrumentedlibs.sh'
13+
- 'ci_build_images/msan.motd'
1314
- 'ci_build_images/qpress.Dockerfile'
1415
- 'ci_build_images/buildbot-worker.Dockerfile'
1516
- .github/workflows/build-debian.msan-based.yml
@@ -20,6 +21,7 @@ on:
2021
- 'ci_build_images/rr.Dockerfile'
2122
- 'ci_build_images/msan.fragment.Dockerfile'
2223
- 'ci_build_images/msan.instrumentedlibs.sh'
24+
- 'ci_build_images/msan.motd'
2325
- 'ci_build_images/qpress.Dockerfile'
2426
- 'ci_build_images/buildbot-worker.Dockerfile'
2527
- .github/workflows/build-debian.msan-based.yml
@@ -50,6 +52,7 @@ jobs:
5052
nogalera: ${{ matrix.nogalera }}
5153
files:
5254
'[
53-
{"name": "msan.instrumentedlibs.sh", "source": "''$WORKDIR/msan.instrumentedlibs.sh''", "target": "''$GITHUB_WORKSPACE''"}
55+
{"name": "msan.instrumentedlibs.sh", "source": "''$WORKDIR/msan.instrumentedlibs.sh''", "target": "''$GITHUB_WORKSPACE''"},
56+
{"name": "msan.motd", "source": "''$WORKDIR/msan.motd''", "target": "''$GITHUB_WORKSPACE''"}
5457
]'
5558
secrets: inherit

ci_build_images/msan.fragment.Dockerfile

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -93,51 +93,10 @@ RUN . /etc/os-release \
9393
COPY --from=rr /tmp/install/usr/ /usr/
9494

9595
# ASAN/UBSAN
96+
COPY msan.motd /etc/motd
97+
9698
RUN echo "cat /etc/motd" > ~buildbot/.bashrc ; \
97-
printf "\
98-
This is a container for ASAN, UBSAN and MSAN building\n\
99-
\n\
100-
A basic MSAN build can be achieved with\n\
101-
\n\
102-
cmake -DWITH_EMBEDDED_SERVER=OFF \\ \n\
103-
-DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \\ \n\
104-
-DPLUGIN_{MROONGA,ROCKSDB,OQGRAPH,SPIDER}=NO \\ \n\
105-
-DWITH_ZLIB=bundled \\ \n\
106-
-DHAVE_LIBAIO_H=0 \\ \n\
107-
-DCMAKE_DISABLE_FIND_PACKAGE_{URING,LIBAIO}=1 \\ \n\
108-
-DWITH_NUMA=NO \\ \n\
109-
-DWITH_SYSTEMD=no \\ \n\
110-
-DWITH_MSAN=ON \\ \n\
111-
-DHAVE_CXX_NEW=1 \\ \n\
112-
-DCMAKE_{EXE,MODULE}_LINKER_FLAGS=\"-L\${MSAN_LIBDIR} -Wl,-rpath=\${MSAN_LIBDIR}\" \\ \n\
113-
-DWITH_DBUG_TRACE=OFF \\ \n\
114-
/source\n\
115-
\n\
116-
A basic combined UBSAN/ASAN build can be achieved with\n\
117-
\n\
118-
cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPED=ON -DWITH_UBSAN=ON -DPLUGIN_PERFSCHEMA=NO /source\n\
119-
\n\
120-
Build with:\n\
121-
\n\
122-
cmake --build .\n\
123-
\n\
124-
Test with:\n\
125-
\n\
126-
mysql-test/mtr --parallel=auto\n\
127-
\n\
128-
There are UBSAN filters covering currently unfixed bugs within\n\
129-
the server that can be used to direct your development, or validate if a\n\
130-
observed failure is known. Perform the following to download/inspect them.\n\
131-
\n\
132-
curl https://raw.githubusercontent.com/mariadb-corporation/mariadb-qa/refs/heads/master/UBSAN.filter -o /build/UBSAN.filter\n\
133-
\n\
134-
After this, add suppressions to UBSAN_OPTIONS with\n\
135-
\n\
136-
export UBSAN_OPTIONS=\$UBSAN_OPTIONS:suppressions=/build/UBSAN.filter\n\
137-
\n\
138-
ref sanitizer flags documents:\n\
139-
* https://github.com/google/sanitizers/wiki/AddressSanitizerFlags\n\
140-
* https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html\n\n" > /etc/motd
99+
chown buildbot: ~buildbot/.bashrc
141100

142101
ENV ASAN_OPTIONS=quarantine_size_mb=512:atexit=0:detect_invalid_pointer_pairs=3:dump_instruction_bytes=1:allocator_may_return_null=1
143102
ENV UBSAN_OPTIONS=print_stacktrace=1:report_error_type=1

ci_build_images/msan.motd

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
This is a container for ASAN, UBSAN and MSAN building
2+
3+
A basic MSAN build can be achieved with:
4+
5+
cmake \
6+
-DUPDATE_SUBMODULES=OFF \
7+
-DWITH_MSAN=ON \
8+
-DCMAKE_{EXE,MODULE}_LINKER_FLAGS="-L${MSAN_LIBDIR} -Wl,-rpath=${MSAN_LIBDIR}" \
9+
-DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \
10+
-DPLUGIN_{MROONGA,ROCKSDB,OQGRAPH,COLUMNSTORE}=NO \
11+
-DWITH_ZLIB=bundled \
12+
-DHAVE_LIBAIO_H=0 \
13+
-DCMAKE_DISABLE_FIND_PACKAGE_{URING,LIBAIO}=1 \
14+
-DWITH_NUMA=NO \
15+
-DWITH_SYSTEMD=no \
16+
-DWITH_DBUG_TRACE=OFF \
17+
-DWITH_EMBEDDED_SERVER=OFF \
18+
/source
19+
20+
A basic combined UBSAN/ASAN build can be achieved with:
21+
22+
cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPED=ON -DWITH_UBSAN=ON -DWITH_UNIT_TESTS=OFF /source
23+
24+
Build with:
25+
26+
cmake --build .
27+
28+
Test with:
29+
30+
mysql-test/mtr --parallel=auto
31+
32+
There are UBSAN filters covering currently unfixed bugs within
33+
the server that can be used to direct your development, or validate if a
34+
observed failure is known. Perform the following to download/inspect them.
35+
36+
curl https://raw.githubusercontent.com/mariadb-corporation/mariadb-qa/refs/heads/master/UBSAN.filter -o /build/UBSAN.filter
37+
38+
After this, add suppressions to UBSAN_OPTIONS with
39+
40+
export UBSAN_OPTIONS=\$UBSAN_OPTIONS:suppressions=/build/UBSAN.filter
41+
42+
ref sanitizer flags documents:
43+
* https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
44+
* https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
45+
* https://mariadb.com/docs/server/server-management/install-and-upgrade-mariadb/installing-mariadb/compiling-mariadb-from-source/compile-and-using-mariadb-with-sanitizers-asan-ubsan-tsan-msan#buildbots-msan-container

0 commit comments

Comments
 (0)