This is an archive of the discontinued LLVM Phabricator instance.

PR23230 Fix asan strtol_strict/strtoll_strict tests
ClosedPublic

Authored by m.guseva on May 27 2015, 9:44 AM.

Diff Detail

Event Timeline

m.guseva updated this revision to Diff 26607.May 27 2015, 9:44 AM
m.guseva retitled this revision from to PR23230 Fix asan strtol_strict/strtoll_strict tests.
m.guseva updated this object.
m.guseva edited the test plan for this revision. (Show Details)
m.guseva added reviewers: kcc, samsonov, glider.
m.guseva added subscribers: Unknown Object (MLST), ygribov.
kcc added inline comments.May 27 2015, 9:59 AM
test/asan/TestCases/strtol_strict.c
45

ouch. This is going to corrupt asan's heap internals and may cause other kinds of flakiness in the test.
I would suggest to allocate a larger buffer, write 0 to the first 8 bytes, apply __asan_poison_memory to those first 8 bytes,
and then pass pass the address to one of those 8 bytes to strtol.
This way you will get a reliable test.

m.guseva updated this revision to Diff 26674.May 28 2015, 5:54 AM

Kostya, thank you.
Attached new patch. What do you think?

kcc accepted this revision.May 28 2015, 6:23 PM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 28 2015, 6:23 PM
This revision was automatically updated to reflect the committed changes.