This is an archive of the discontinued LLVM Phabricator instance.

[asan] Use MADV_NOCORE for use_madv_dontdump on FreeBSD.
ClosedPublic

Authored by MaskRay on Jun 16 2018, 2:27 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Jun 16 2018, 2:27 PM

On Linux, I can observe the effect of the option:

ulimit -c 100; rm -f core; ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:use_madv_dontdump=1 ./a; readelf -Wl core | grep 2008f
ulimit -c 100; rm -f core; ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:use_madv_dontdump=0 ./a; readelf -Wl core | grep 2008f
# the file size field is 0 with use_madv_dontdump=1
  LOAD           0x92e000 0x000002008fff7000 0x0000000000000000 0xdfff0001000 0xdfff0001000 RW  0x1000
khng300 accepted this revision.Jun 30 2018, 1:24 AM
khng300 added a subscriber: khng300.

Just tested it on FreeBSD 11.2, the relevant changes look fine to me.

This revision is now accepted and ready to land.Jun 30 2018, 1:24 AM
This revision was automatically updated to reflect the committed changes.