Summary: | Android runtime linker ignores DF_1_INTERPOSE in vgpreload_core-* | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | John Reiser <jreiser> |
Component: | memcheck | Assignee: | Julian Seward <jseward> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | naesten, tom, wuweijia |
Priority: | NOR | ||
Version First Reported In: | 3.14.0 | ||
Target Milestone: | --- | ||
Platform: | Android | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
John Reiser
2019-04-09 05:50:23 UTC
I believe that comes from -Wl,-z,interpose,-z,initfirst being included in PRELOAD_LDFLAGS_COMMON_LINUX in Makefile.all.am. Now obviously we can avoid doing that for Android - obviously that might mean we are less successfully at interposing the functions we want to replace though. Actually thinking about it we don't really rely on interposition these days, so do we really need those at all? I think those flags were originally introduced in 918c3a7b7e01abedf840c6fa8786df41192bf737 by Jeremy way back in 2003! These Text "linker: Warning: "/system_Q_EA3/lib64/valgrind/vgpreload_core-arm64-linux.so" has unsupported flags DT_FLAGS_1=0x421 (ignoring unsupported flags)" has been existed for several version from valgrind 3.12 and android 7 . and these version are all worked (valgrind can detect the memory leak). But only android Q is failed. Just to clarify: this warning always prints the full set of flags found in the DT_FLAGS_1 entry, including the supported ones, from its introduction at <https://cs.android.com/android/_/android/platform/bionic/+/6cdeb5234d7f4523fe9d83974f265d80f10512a6:linker/linker.cpp;drc=6cdeb5234d7f4523fe9d83974f265d80f10512a6;l=2067> to its current version at <https://cs.android.com/android/_/android/platform/bionic/+/7ea4c99263fb09c4590135e78bc26fa4e5786083:linker/linker.cpp;drc=7ea4c99263fb09c4590135e78bc26fa4e5786083;l=3186>. The actual set of supported flags seems to range from `DF_1_NOW | DF_1_GLOBAL` to `DF_1_NOW | DF_1_GLOBAL | DF_1_NODELETE | DF_1_PIE | DF_1_ORIGIN`. In any case, since `DF_1_INTERPOSE` and `DF_1_INITFIRST` never "worked" on Android, the warning is presumably unrelated to any regressions you're encountering with leak tracking. Actually, there's an FAQ entry titled "Memcheck doesn't report any errors and I know my program has errors." at <https://valgrind.org/docs/manual/faq.html#faq.hiddenbug>; it seems likely that your issue was caused by statically linking libc or libc++ into your test program? |