MPS issue job003643

TitleCan't use the MPS with clang -fsanitize=address
Statusclosed
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIf you compile your program with the MPS using clang -fsanitize=address [1], then it will abort with

     ERROR: AddressSanitizer: stack-buffer-overflow

as described in [3]. This will be inconvenient for developers.
AnalysisWe need to set __attribute__((no_sanitize_address)) [2] on the function(s) that scan the stack, so that the address sanitizer does not report false positives.

At the moment the only such function appears to be TraceScanAreaMasked. But I don't think we want to just set the attribute on that function, because that's also called from RootScan, and so we might be missing some potentially useful feedback: if the client program's root scanner runs off the end of a buffer, they might want to find out via the address sanitizer. So potentially we'd have to have two versions of TraceScanAreaMasked (one with the no_sanitize_address attribute, to be called from StackScanInner, and one without, to be called from RootScan), which would be ugly. (But potentially losing useful feedback is a much less important problem than aborting, so this shouldn't stop us.)
How foundmanual_test
Evidence[1] <http://llvm.org/releases/3.3/tools/clang/docs/AddressSanitizer.html>
[2] <http://llvm.org/releases/3.3/tools/cla...izer.html#attribute-no-sanitize-address>
[3] <https://info.ravenbrook.com/mail/2013/10/31/10-03-54/0/>
Created byGareth Rees
Created on2013-10-31 11:13:53
Last modified byGareth Rees
Last modified on2014-03-30 18:51:53
History2013-10-31 GDR Created.

Fixes

Change Effect Date User Description
185096 closed 2014-03-30 18:51:53 Gareth Rees Support the Clang address sanitizer.