Skip to content

Track UBSan runtime errors reported by x86 ASan CI #1960

@jac0626

Description

@jac0626

Parent tracking issue: #1950

The x86 ASan CI already reports several UBSan runtime errors, but the job still passes because the current sanitizer configuration allows UBSan recovery.

Related x86 CI logs:

The build log shows GCC 11.4.0 and Compiling with AddressSanitizer and UndefinedBehaviorSanitizer, so these reports are not caused by macOS-only sanitizer behavior.

Observed x86 UBSan reports include:

  • src/algorithm/hnswlib/hnswalg.cpp:319: store to misaligned address for linklistsizeint.
  • src/algorithm/hnswlib/hnswalg.cpp:342: store to misaligned address for linklistsizeint.
  • src/algorithm/hnswlib/hnswalg.h:422: load of misaligned address for unsigned short.
  • src/algorithm/hnswlib/hnswalg.h:427: store to misaligned address for unsigned short.
  • src/impl/bitset/fast_bitset.cpp:237: null pointer passed to memcpy.
  • src/algorithm/inner_index_interface.cpp:200: null pointer passed to memcpy.
  • src/datacell/sparse_term_datacell.cpp:150: reference binding to null pointer.

Why CI still passes:

The current ASan build uses -fsanitize=address,undefined, but it does not make UBSan reports fatal. There is no UBSAN_OPTIONS=halt_on_error=1, and the build does not use -fno-sanitize-recover=undefined. As a result, UBSan prints runtime error diagnostics and the test process can still exit with code 0.

Sub-issues:

Related macOS-observed UBSan follow-up:

Suggested plan:

  • Fix each UB class in focused PRs.
  • Start with the deterministic x86 reports above, since they are already visible in current CI logs.
  • After known UBSan reports are fixed, consider making sanitizer CI stricter by setting UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 or adding -fno-sanitize-recover=undefined.

Non-goals:

  • Do not mix these fixes into the macOS CI/build PR.
  • Do not enable fatal UBSan mode before the known reports are fixed, otherwise existing CI will fail immediately.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions