Details
-
Bug
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.11
-
None
-
Not for Release Notes
Description
Problem:
Infer, the static analysis tool selected to scan our codebase causes lots of errors on UNINIT_VAR.
Infer is clang based, but doesn't support UBSAN.
$ cmake -DWITH_UBSAN=ON -DCMAKE_C_COMPILER=/usr/local/lib/infer/infer/lib/wrappers/clang -DCMAKE_CXX_COMPILER=/usr/local/lib/infer/infer/lib/wrappers/clang++ ../mariadb-server-rebase/
|
-- The C compiler identification is Clang 20.1.1
|
-- The CXX compiler identification is Clang 20.1.1
|
-- Detecting C compiler ABI info
|
-- Detecting C compiler ABI info - done
|
-- Check for working C compiler: /usr/local/lib/infer/infer/lib/wrappers/clang - skipped
|
-- Detecting C compile features
|
-- Detecting C compile features - done
|
-- Detecting CXX compiler ABI info
|
-- Detecting CXX compiler ABI info - done
|
-- Check for working CXX compiler: /usr/local/lib/infer/infer/lib/wrappers/clang++ - skipped
|
-- Detecting CXX compile features
|
-- Detecting CXX compile features - done
|
-- Running cmake version 3.31.6
|
...have_C__fsanitize_undefined__fno_sanitize_alignment__U_FORTIFY_SOURCE__DWITH_UBSAN
|
-- Performing Test have_C__fsanitize_undefined__fno_sanitize_alignment__U_FORTIFY_SOURCE__DWITH_UBSAN - Failed
|
-- Performing Test have_CXX__fsanitize_undefined__fno_sanitize_alignment__U_FORTIFY_SOURCE__DWITH_UBSAN
|
-- Performing Test have_CXX__fsanitize_undefined__fno_sanitize_alignment__U_FORTIFY_SOURCE__DWITH_UBSAN - Failed
|
The failing test on WITH_UBSAN result in no UBSAN removal of fake initialization and the result is full of uninitialised value is read and a dead store.
Solution:
As added in 0c80ddb519bd06efbd7ccf2a2487b2503cd16db5 the build with error on any clang base uninitialised warning.
With this in place, the original _clang_ proposed in MDEV-36542.
Attachments
Issue Links
- blocks
-
MDBF-143 Implement static analysis with Infer
-
- Open
-
- relates to
-
MDEV-36542 Remove some markers that variable is not going to be used uninitalized in clang
-
- Closed
-