When implementing new build variants for UBSAN in WT-7552, a number of errors of the following signature were detected in src/txn/txn_ckpt.c:
[2021/06/22 03:38:04.299] ../src/txn/txn_ckpt.c:1547:5: runtime error: load of value 127, which is not a valid value for type 'bool'
The offending line is as follows:
WT_UNUSED(seen_ckpt_add);
The reason for this error is that an uninitialized bool will have an indeterminate value, which is undefined behavior. The seen_ckpt_add variable is not initialized until late in the function and there are code paths that would skip this initialization completely. Moving the variable initialization to earlier in the function would prevent this sanitizer error.
- is related to
-
WT-7741 Fix misaligned address in crc32-x86.c
- Closed
-
WT-7742 Fix misaligned address in wt3184_dup_index_collator/main.c
- Closed
-
WT-7743 Fix integer overflow within wt2999_join_extractor csuite test
- Closed
-
WT-7744 Fix null pointer within wt3338_partial_update csuite
- Closed
- related to
-
WT-7552 Add UBSAN to automated WT testing
- Closed