This is an archive of the discontinued LLVM Phabricator instance.

Add C++17 aligned new/delete interceptors to standalone lsan
ClosedPublic

Authored by fjricci on Aug 15 2017, 10:47 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

fjricci created this revision.Aug 15 2017, 10:47 AM
fjricci updated this revision to Diff 111207.Aug 15 2017, 10:52 AM

Also add missing interceptors for delete(ptr, size)

alekseyshl added inline comments.Aug 15 2017, 2:02 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

Don't we need to intercept by mangled names here too?

fjricci added inline comments.Aug 15 2017, 2:06 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

ASan currently does not. Shouldn't be hard to add the mangled name interception for both ASan and LSan in a second patch (unless you'd rather have it all here).

alekseyshl added inline comments.Aug 15 2017, 2:39 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

Why not, let's add them in this patch.

fjricci added inline comments.Aug 15 2017, 2:55 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

Sounds good.

alekseyshl added inline comments.Aug 15 2017, 3:09 PM
lib/lsan/lsan_interceptors.cc
207 ↗(On Diff #111207)

Use lsan_malloc instead of lsan_memalign, one less parameter and check.

fjricci added inline comments.Aug 15 2017, 3:37 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

I don't think we can add these on macOS until they're added in libc++, otherwise we get undefined symbol errors.

alekseyshl added inline comments.Aug 15 2017, 3:50 PM
lib/lsan/lsan_interceptors.cc
305 ↗(On Diff #111207)

OK then, let's do it later.

fjricci updated this revision to Diff 111278.Aug 15 2017, 4:12 PM

memalign -> malloc

alekseyshl accepted this revision.Aug 16 2017, 10:50 AM
This revision is now accepted and ready to land.Aug 16 2017, 10:50 AM
This revision was automatically updated to reflect the committed changes.