This is an archive of the discontinued LLVM Phabricator instance.

[msan] Skip memcpy interceptor called by gethostname
ClosedPublic

Authored by vitalybuka on Sep 25 2020, 1:40 AM.

Details

Summary

No test as reproducer requires particular glibc build.

Diff Detail

Event Timeline

vitalybuka created this revision.Sep 25 2020, 1:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2020, 1:40 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka requested review of this revision.Sep 25 2020, 1:40 AM

I'm concerned that this may break more things that it will fix.
We may have code relying on initialization done by an memcpy call from under some other interceptor. That's not very reliable, of course, and ideally all such effects should be handled in the top-level interceptor, so this change looks like movement in the right direction.
But please test it thoroughly.

Could you explain in more detail what is going wrong without it? It looks like gethostname interceptor updates shadow for all its side effects correctly.

dxf added a subscriber: dxf.Sep 25 2020, 12:16 PM

corrected fix

undo unrelated changes

undo unrelated changes for real

eugenis accepted this revision.Sep 25 2020, 3:18 PM

LGTM

compiler-rt/lib/msan/msan_interceptors.cpp
830

(res >= 0 || errno == errno_ENAMETOOLONG)

This revision is now accepted and ready to land.Sep 25 2020, 3:18 PM
Harbormaster completed remote builds in B73022: Diff 294437.
vitalybuka marked an inline comment as done.Sep 25 2020, 3:25 PM
vitalybuka added inline comments.
compiler-rt/lib/msan/msan_interceptors.cpp
830

discussed offline, keep as is

This revision was landed with ongoing or failed builds.Sep 25 2020, 3:26 PM
This revision was automatically updated to reflect the committed changes.
vitalybuka marked an inline comment as done.