mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8001185: parsing of sun.boot.library.path in os::dll_build_name somewhat broken
Dll_dir can contain multiple paths, need to parse them correctly when loading agents Reviewed-by: dholmes, dlong
This commit is contained in:
parent
40d5fa156c
commit
dd5c8eb660
9 changed files with 67 additions and 35 deletions
|
@ -3706,8 +3706,10 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent, const char *on_load_sym
|
|||
}
|
||||
} else {
|
||||
// Try to load the agent from the standard dll directory
|
||||
os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name);
|
||||
library = os::dll_load(buffer, ebuf, sizeof ebuf);
|
||||
if (os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
|
||||
name)) {
|
||||
library = os::dll_load(buffer, ebuf, sizeof ebuf);
|
||||
}
|
||||
#ifdef KERNEL
|
||||
// Download instrument dll
|
||||
if (library == NULL && strcmp(name, "instrument") == 0) {
|
||||
|
@ -3732,8 +3734,9 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent, const char *on_load_sym
|
|||
#endif // KERNEL
|
||||
if (library == NULL) { // Try the local directory
|
||||
char ns[1] = {0};
|
||||
os::dll_build_name(buffer, sizeof(buffer), ns, name);
|
||||
library = os::dll_load(buffer, ebuf, sizeof ebuf);
|
||||
if (os::dll_build_name(buffer, sizeof(buffer), ns, name)) {
|
||||
library = os::dll_load(buffer, ebuf, sizeof ebuf);
|
||||
}
|
||||
if (library == NULL) {
|
||||
const char *sub_msg = " on the library path, with error: ";
|
||||
size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue