This is an archive of the discontinued LLVM Phabricator instance.

Intercept tzset in MSan on NetBSD
AbandonedPublic

Authored by krytarowski on Jan 15 2018, 12:07 AM.

Details

Summary

Handle function renaming tzset -> __tzset50 on NetBSD.

Reset arguments passed to tzset() as it does not accept
input parameters.

The tzset() syscall must be called on NetBSD with
InterceptorScope. Once a user sets timezone (either
by TZ or /etc/localtime symlink), tzset() reloads the
internal data and this reports false-positive alarms.

Other functions (like the localtime() interceptor)
already use InterceptorScope.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Jan 15 2018, 12:07 AM
vitalybuka added inline comments.Jan 19 2018, 12:46 PM
lib/msan/msan_interceptors.cc
1142

Any idea why we had "int fake" there?

krytarowski added inline comments.Jan 19 2018, 4:20 PM
lib/msan/msan_interceptors.cc
1142

It looks like a bug, maybe @eugenis can share more insight.

eugenis added inline comments.Jan 19 2018, 4:23 PM
lib/msan/msan_interceptors.cc
1142

That's to suppress compiler warnings about vararg macros with no arguments, or something like that.

krytarowski added inline comments.Jan 19 2018, 4:32 PM
lib/msan/msan_interceptors.cc
1142

I'm not observing warnings locally. Unless I miss something, calling a function with fake arguments breaks ABI constraints (but it's tolerable in this particular case on x86_64).

eugenis added inline comments.Jan 19 2018, 4:41 PM
lib/msan/msan_interceptors.cc
1142

try search code history. Could have been GCC.

devnexen added inline comments.
lib/msan/msan_interceptors.cc
1142

Just to add a point, it helps to solves an issue in my pending request, in FreeBSD we really need to have the correct signature.

krytarowski planned changes to this revision.Mar 7 2018, 1:26 AM

I've entirely switched to NetBSD kernel fixes in order to host fully-functional LLDB. Once I will be done with the debugger, I will be back to sanitizers and work on connecting a buildbot and remaining fixes and cleanup.

krytarowski requested review of this revision.Nov 2 2018, 3:19 PM
krytarowski abandoned this revision.Nov 4 2018, 7:33 AM

I will abandon it for now, if it will make problems again I will show up with a new patch.