This is an archive of the discontinued LLVM Phabricator instance.

[asan] Versioned interceptor for pthread_create.
ClosedPublic

Authored by eugenis on Sep 22 2015, 2:05 PM.

Details

Summary

This fixes a crash in pthread_create on linux/i386 due to abi
incompatibility between intercepted and non-intercepted functions.

See the test case for more details.

This is ugly, of course.
Other ideas:

  1. Deprecate static runtime and provide version-specific interceptors in the shared runtime library. Versioned symbols are not supported in executables, hence the need for the shared runtime. This is the _correct_ fix, but we can not really deprecate static runtime, though.
  2. Add interceptors for all multi-version libc functions. I see ~12 of those that we don't have interceptors for yet. This is not exactly right either, because we end up with the old abi we could not match the abi of the application.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 35413.Sep 22 2015, 2:05 PM
eugenis retitled this revision from to [asan] Versioned interceptor for pthread_create..
eugenis updated this object.
eugenis added reviewers: samsonov, dvyukov, kcc.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: llvm-commits.
samsonov accepted this revision.Sep 22 2015, 2:12 PM
samsonov edited edge metadata.

LGTM

lib/asan/asan_interceptors.h
110

Did you clang-format it for the wrong style?

lib/interception/interception_linux.h
38

Did you clang-format it for the wrong style? (we use # define instead of #define where appropriate)

This revision is now accepted and ready to land.Sep 22 2015, 2:12 PM
eugenis updated this revision to Diff 35418.Sep 22 2015, 2:25 PM
eugenis edited edge metadata.

fixed formatting

eugenis closed this revision.Sep 22 2015, 2:37 PM

r248325