This is an archive of the discontinued LLVM Phabricator instance.

[Bitstream] Temporarily disable UBSan for invalid bitcode tests. This fixes failing sanitizer buildbots.
ClosedPublic

Authored by browneee on Feb 7 2022, 12:45 PM.

Details

Summary

Tests added by

https://github.com/llvm/llvm-project/commit/3c86642edd28f1ce970882edaba8dce468ec7401
https://github.com/llvm/llvm-project/commit/f4fca0fbb052e55935b483c8955c440b59511ce8

cause existing code to exhibit UB:

https://github.com/llvm/llvm-project/blob/b4c6d1bb379192cb5b712fda9f60cd105f21194f/llvm/include/llvm/Bitstream/BitstreamReader.h#L244

llvm/include/llvm/Bitstream/BitstreamReader.h:244:51:
runtime error: shift exponent 35 is too large for 32-bit type 'unsigned int'

Hitting the UBSan error before the expected error causes the test to fail under UBSan:

Diff Detail

Event Timeline

browneee requested review of this revision.Feb 7 2022, 12:45 PM
browneee created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2022, 12:45 PM
vitalybuka accepted this revision.Feb 7 2022, 1:51 PM
vitalybuka added inline comments.
llvm/test/Bitcode/invalid-no-ubsan.test
12–20

Please don't move lines unnecessary

This revision is now accepted and ready to land.Feb 7 2022, 1:51 PM
browneee added inline comments.Feb 7 2022, 1:54 PM
llvm/test/Bitcode/invalid-no-ubsan.test
12–20

Do you mean do not move these lines into a different file?

Then UNSUPPORTED: ubsan would disable all of the other tests that do work under UBSan. That could allow more UB to enter.

This revision was landed with ongoing or failed builds.Feb 7 2022, 1:56 PM
This revision was automatically updated to reflect the committed changes.