8080538: hprof does not work well with multiple agents on non-Solaris platforms
Never take the address of Agent_OnLoad. Reviewed-by: sla, martin
This commit is contained in:
parent
eb68509b7d
commit
13c92b58f0
@ -290,19 +290,7 @@ md_get_prelude_path(char *path, int path_len, char *filename)
|
|||||||
Dl_info dlinfo;
|
Dl_info dlinfo;
|
||||||
|
|
||||||
libdir[0] = 0;
|
libdir[0] = 0;
|
||||||
#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX)
|
addr = (void*)&md_get_prelude_path;
|
||||||
addr = (void*)&Agent_OnLoad;
|
|
||||||
#else
|
|
||||||
/* Just using &Agent_OnLoad will get the first external symbol with
|
|
||||||
* this name in the first .so, which may not be libhprof.so.
|
|
||||||
* On Solaris we can actually ask for the address of our Agent_OnLoad.
|
|
||||||
*/
|
|
||||||
addr = dlsym(RTLD_SELF, "Agent_OnLoad");
|
|
||||||
/* Just in case the above didn't work (missing linker patch?). */
|
|
||||||
if ( addr == NULL ) {
|
|
||||||
addr = (void*)&Agent_OnLoad;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Use dladdr() to get the full path to libhprof.so, which we use to find
|
/* Use dladdr() to get the full path to libhprof.so, which we use to find
|
||||||
* the prelude file.
|
* the prelude file.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user