This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] Use struct instead of array in sancov.py
ClosedPublic

Authored by slthakur on Apr 6 2016, 2:05 AM.

Details

Summary

When using 32-bit python with 64-bit asan the pc array in sancov.py cannot fit in 64-bit pc's because the type-code 'L' for arrays in python corresponds to the C type long which is only of 4 bytes. Because of this some of the coverage tool tests fail on mips. To fix these test possible solutions are to use 64-bit python or use struct.unpack with the 'Q' type-code. We have used struct.unpack with 'Q' type code since it is not appropriate to have a 64-bit python on all hosts.

Diff Detail

Repository
rL LLVM

Event Timeline

slthakur updated this revision to Diff 52770.Apr 6 2016, 2:05 AM
slthakur retitled this revision from to [ASAN] Use struct instead of array in sancov.py.
slthakur updated this object.
slthakur added reviewers: dsanders, kcc, samsonov.
slthakur set the repository for this revision to rL LLVM.
slthakur updated this revision to Diff 52775.Apr 6 2016, 3:28 AM
slthakur edited edge metadata.

Added similar change to MergeAndPrint and ReadOneFIle

Gentle reminder.

I'd like to eventually deprecate the use of sancov.py in favor of the C++-based sancov.
Does this tool work for you?

Yes, sancov.py works properly for me.

kcc added a comment.Apr 15 2016, 9:23 AM

Yes, sancov.py works properly for me.

That wasn't my question.
I asked whether the new C++-based sancov (no .py) works for you.
http://clang.llvm.org/docs/SanitizerCoverage.html#sancov-tool

aizatsky accepted this revision.Apr 15 2016, 11:10 AM
aizatsky edited edge metadata.

Yes, making sancov.cc working for you would be ideal.

As for this change, it does make existing code better in terms of bitness flexibility.

This revision is now accepted and ready to land.Apr 15 2016, 11:10 AM
slthakur closed this revision.Apr 22 2016, 2:27 AM

Committed in revision 267126