This is an archive of the discontinued LLVM Phabricator instance.

[asan][test] Disable malloc-no-intercept.c on Solaris
ClosedPublic

Authored by ro on Sep 18 2020, 5:21 AM.

Details

Summary

TestCases/malloc-no-intercept.c FAILs on Solaris/x86, e.g. with -Dtestfunc=mallinfo:

/usr/bin/ld: /tmp/malloc-no-intercept-586529.o: in function `main':
/vol/llvm/src/llvm-project/dist/compiler-rt/test/asan/TestCases/malloc-no-intercept.c:30: undefined reference to `nonexistent_function'
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

This is not surprising, actually:

  • mallinfo and mallopt only exist in libmalloc
  • pvalloc doesn't exist all all
  • cfree does exist in libc, but isn't declared in any public header and the OpenSolaris sources reveal that it has a different signature than on Linux
  • only memalign is a public interface

To avoid this, this patch disables the interceptors for all but meminfo. Additionally, the test is marked UNSUPPORTED on Solaris since the memalign and cfree variants do link on Solaris.

Tested on amd64-pc-solaris2.11.

It seems a bit weird that for this apparently glibc-only group of interfaces every non-glibc target not only has to analyze the failure, but opt out of the interceptors. It would feel way more natural the other way round: opt-in for known users only.

Diff Detail

Event Timeline

ro created this revision.Sep 18 2020, 5:21 AM
Herald added subscribers: Restricted Project, fedor.sergeev. · View Herald TranscriptSep 18 2020, 5:21 AM
ro requested review of this revision.Sep 18 2020, 5:21 AM
vitalybuka accepted this revision.Sep 24 2020, 1:59 AM
vitalybuka added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
505

please clang-format this part

This revision is now accepted and ready to land.Sep 24 2020, 1:59 AM
ro marked an inline comment as done.Sep 24 2020, 2:57 AM
ro added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
505

I had done so, however at that point the LLVM 10 clang-format
was in my PATH. Fixed now.

This revision was landed with ongoing or failed builds.Sep 24 2020, 2:59 AM
This revision was automatically updated to reflect the committed changes.
ro marked an inline comment as done.