mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6786948: SA on core file fails on solaris-amd64 if vm started with -XX:+StartAttachListener
Reviewed-by: jjh, dcubed
This commit is contained in:
parent
74a472983b
commit
b15aadf61d
2 changed files with 16 additions and 10 deletions
|
@ -238,8 +238,8 @@ struct FileMapHeader {
|
||||||
// Ignore the rest of the FileMapHeader. We don't need those fields here.
|
// Ignore the rest of the FileMapHeader. We don't need those fields here.
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool read_int(struct ps_prochandle* ph, uintptr_t addr, int* pvalue) {
|
static bool read_jboolean(struct ps_prochandle* ph, uintptr_t addr, jboolean* pvalue) {
|
||||||
int i;
|
jboolean i;
|
||||||
if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) {
|
if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) {
|
||||||
*pvalue = i;
|
*pvalue = i;
|
||||||
return true;
|
return true;
|
||||||
|
@ -295,7 +295,7 @@ static bool init_classsharing_workaround(struct ps_prochandle* ph) {
|
||||||
int fd = -1, m = 0;
|
int fd = -1, m = 0;
|
||||||
uintptr_t base = 0, useSharedSpacesAddr = 0;
|
uintptr_t base = 0, useSharedSpacesAddr = 0;
|
||||||
uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0;
|
uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0;
|
||||||
int useSharedSpaces = 0;
|
jboolean useSharedSpaces = 0;
|
||||||
map_info* mi = 0;
|
map_info* mi = 0;
|
||||||
|
|
||||||
memset(classes_jsa, 0, sizeof(classes_jsa));
|
memset(classes_jsa, 0, sizeof(classes_jsa));
|
||||||
|
@ -306,12 +306,15 @@ static bool init_classsharing_workaround(struct ps_prochandle* ph) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_int(ph, useSharedSpacesAddr, &useSharedSpaces) != true) {
|
// Hotspot vm types are not exported to build this library. So
|
||||||
|
// using equivalent type jboolean to read the value of
|
||||||
|
// UseSharedSpaces which is same as hotspot type "bool".
|
||||||
|
if (read_jboolean(ph, useSharedSpacesAddr, &useSharedSpaces) != true) {
|
||||||
print_debug("can't read the value of 'UseSharedSpaces' flag\n");
|
print_debug("can't read the value of 'UseSharedSpaces' flag\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useSharedSpaces == 0) {
|
if ((int)useSharedSpaces == 0) {
|
||||||
print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n");
|
print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,8 +502,8 @@ struct FileMapHeader {
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
read_int(struct ps_prochandle* ph, psaddr_t addr, int* pvalue) {
|
read_jboolean(struct ps_prochandle* ph, psaddr_t addr, jboolean* pvalue) {
|
||||||
int i;
|
jboolean i;
|
||||||
if (ps_pread(ph, addr, &i, sizeof(i)) == PS_OK) {
|
if (ps_pread(ph, addr, &i, sizeof(i)) == PS_OK) {
|
||||||
*pvalue = i;
|
*pvalue = i;
|
||||||
return true;
|
return true;
|
||||||
|
@ -575,10 +575,13 @@ init_classsharing_workaround(void *cd, const prmap_t* pmap, const char* obj_name
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the value of the flag "UseSharedSpaces"
|
// read the value of the flag "UseSharedSpaces"
|
||||||
int value = 0;
|
// Since hotspot types are not available to build this library. So
|
||||||
if (read_int(ph, useSharedSpacesAddr, &value) != true) {
|
// equivalent type "jboolean" is used to read the value of "UseSharedSpaces"
|
||||||
|
// which is same as hotspot type "bool".
|
||||||
|
jboolean value = 0;
|
||||||
|
if (read_jboolean(ph, useSharedSpacesAddr, &value) != true) {
|
||||||
THROW_NEW_DEBUGGER_EXCEPTION_("can't read 'UseSharedSpaces' flag", 1);
|
THROW_NEW_DEBUGGER_EXCEPTION_("can't read 'UseSharedSpaces' flag", 1);
|
||||||
} else if (value == 0) {
|
} else if ((int)value == 0) {
|
||||||
print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n");
|
print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue