ldc icon indicating copy to clipboard operation
ldc copied to clipboard

ASan: add sanitizing GC allocated memory

Open JohanEngelen opened this issue 8 years ago • 3 comments

A bug like this should be caught by ASan (simplified testcase of course, so boundscheck=off):

int getX()
{
        byte[] x = new byte[5];
        return x[5];
}

See testcase sanitizers/asan_dynalloc.d from PR #2228 . See https://forum.dlang.org/post/[email protected]

JohanEngelen avatar Jul 21 '17 20:07 JohanEngelen

Any update on the status of this issue? 🤔 It seems that one of the PRs you mentioned is already merged.

aminya avatar May 31 '21 06:05 aminya

I have not looked into this for a while. It is certainly not working (the merged PR contains a disabled test case).

JohanEngelen avatar May 31 '21 16:05 JohanEngelen

Implementing this will require an LLVM change by the way. Edit: this is not quite accurate. This is implementable without modifying LLVM. Good error messages will require LLVM changes, but not error detection itself (druntime GC changes only)

JohanEngelen avatar May 31 '21 16:05 JohanEngelen