This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Work around undefined behaviour in ldecod
ClosedPublic

Authored by ostannard on Feb 18 2020, 7:07 AM.

Details

Summary

The NUM_BLOCK_TYPES macro is defined to 10, but the arrays in ctx_tables.h only have 8 elements in the relevant dimension, so this was causing out of bounds array accesses, and segfaults if we were (un)lucky. I don't know enough about H264 decoding to know if this is the right fix, but it fixes the segfault currently affecting the Arm LNT bot, and doesn't change the expected output.

Diff Detail

Event Timeline

ostannard created this revision.Feb 18 2020, 7:07 AM
Herald added a project: Restricted Project. ยท View Herald TranscriptFeb 18 2020, 7:07 AM
kristof.beyls accepted this revision.Feb 19 2020, 5:12 AM

After chatting with Oliver, he states that he did run ubsan before and after this change, and the undefined behaviour that was causing the segfaults is gone with this change.
(There are apparently other undefined behaviours flagged by ubsan, but they are unrelated).
I also don't know much about H264 decoding, but the removal of undefined behaviour as indicated by ubsan together with no change in output makes me believe this change is good enough for how the test-suite is used.
LGTM.

This revision is now accepted and ready to land.Feb 19 2020, 5:12 AM