Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.cpp @ 6966:6cb0d32b828b
8001185: parsing of sun.boot.library.path in os::dll_build_name somewhat broken
Summary: dll_dir can contain multiple paths, need to parse them correctly when loading agents
Reviewed-by: dholmes, dlong
Contributed-by: bill.pittore@oracle.com
author | bpittore |
---|---|
date | Wed, 07 Nov 2012 17:53:02 -0500 |
parents | a1b8cf9cf970 |
children | d9a84e246cce |
comparison
equal
deleted
inserted
replaced
6932:857f3ce858dd | 6966:6cb0d32b828b |
---|---|
3704 vm_exit_during_initialization(buf, NULL); | 3704 vm_exit_during_initialization(buf, NULL); |
3705 FREE_C_HEAP_ARRAY(char, buf, mtThread); | 3705 FREE_C_HEAP_ARRAY(char, buf, mtThread); |
3706 } | 3706 } |
3707 } else { | 3707 } else { |
3708 // Try to load the agent from the standard dll directory | 3708 // Try to load the agent from the standard dll directory |
3709 os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name); | 3709 if (os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), |
3710 library = os::dll_load(buffer, ebuf, sizeof ebuf); | 3710 name)) { |
3711 library = os::dll_load(buffer, ebuf, sizeof ebuf); | |
3712 } | |
3711 #ifdef KERNEL | 3713 #ifdef KERNEL |
3712 // Download instrument dll | 3714 // Download instrument dll |
3713 if (library == NULL && strcmp(name, "instrument") == 0) { | 3715 if (library == NULL && strcmp(name, "instrument") == 0) { |
3714 char *props = Arguments::get_kernel_properties(); | 3716 char *props = Arguments::get_kernel_properties(); |
3715 char *home = Arguments::get_java_home(); | 3717 char *home = Arguments::get_java_home(); |
3730 library = os::dll_load(buffer, ebuf, sizeof ebuf); | 3732 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3731 } | 3733 } |
3732 #endif // KERNEL | 3734 #endif // KERNEL |
3733 if (library == NULL) { // Try the local directory | 3735 if (library == NULL) { // Try the local directory |
3734 char ns[1] = {0}; | 3736 char ns[1] = {0}; |
3735 os::dll_build_name(buffer, sizeof(buffer), ns, name); | 3737 if (os::dll_build_name(buffer, sizeof(buffer), ns, name)) { |
3736 library = os::dll_load(buffer, ebuf, sizeof ebuf); | 3738 library = os::dll_load(buffer, ebuf, sizeof ebuf); |
3739 } | |
3737 if (library == NULL) { | 3740 if (library == NULL) { |
3738 const char *sub_msg = " on the library path, with error: "; | 3741 const char *sub_msg = " on the library path, with error: "; |
3739 size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1; | 3742 size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1; |
3740 char *buf = NEW_C_HEAP_ARRAY(char, len, mtThread); | 3743 char *buf = NEW_C_HEAP_ARRAY(char, len, mtThread); |
3741 jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); | 3744 jio_snprintf(buf, len, "%s%s%s%s", msg, name, sub_msg, ebuf); |