This is an archive of the discontinued LLVM Phabricator instance.

[msan] Don't intercept LFS prlimit64/getrlimit64 on musl
ClosedPublic

Authored by thesamesam on May 18 2023, 5:59 PM.

Details

Summary

These are aliases on musl and as of 1.2.4, aren't visible by default
(only with -D_LARGEFILE64_SOURCE), and will be removed entirely in a future
release.

This fixes a runtime failure with msan on musl-1.2.4:

$ echo 'int main(){}' | clang -x c - -fsanitize=memory -o /dev/null
/usr/bin/x86_64-gentoo-linux-musl-ld.bfd: /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/libclang_rt.msan-x86_64.a(msan_interceptors.cpp.o): in function `__interceptor_getrlimit64':
[...]

Bug: https://bugs.gentoo.org/906603

Diff Detail

Event Timeline

thesamesam created this revision.May 18 2023, 5:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2023, 5:59 PM
Herald added subscribers: Enna1, pengfei. · View Herald Transcript
thesamesam requested review of this revision.May 18 2023, 5:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2023, 5:59 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
thesamesam added a reviewer: Restricted Project.May 18 2023, 5:59 PM

I think we've had a similar set of changes like this before but I can't find them right now...

MaskRay accepted this revision.May 18 2023, 7:06 PM

This is similar to D141186

This revision is now accepted and ready to land.May 18 2023, 7:06 PM
This revision was landed with ongoing or failed builds.May 20 2023, 6:06 PM
This revision was automatically updated to reflect the committed changes.