Details
-
Bug
-
Resolution: Fixed
-
P4
-
11, 16
-
b02
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8267395 | 11.0.13-oracle | Harold Seigel | P4 | Resolved | Fixed | b01 |
JDK-8267437 | 11.0.12 | Thomas Stuefe | P4 | Resolved | Fixed | b04 |
Description
In our primary hotspot signal handlers, SafeFetch handling is limited to JavaThread objects:
```
JavaThread* thread = NULL;
...
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
}
...
if (info != NULL && uc != NULL && thread != NULL) {
pc = (address) os::Linux::ucontext_get_pc(uc);
if (StubRoutines::is_safefetch_fault(pc)) {
```
As a result of this, using SafeFetch may crash non-JavaThreads if the location is invalid. E.g. using SafeFetch inside a VMOperation may crash the VM.
This is unfortunate since SafeFetch is used for os::is_readable_pointer() which explicitly promises to not crash. It is used e.g. in os::print_hex_dump(). There is also no reason why SafeFetch would not work for non-JavaThreads. In fact, SafeFetch handling for the secondary signal handler works just fine for all threads.
This is an old bug, unrelated to the recent Posix cleanups. AFAICS it has been there at least since Jdk11.
```
JavaThread* thread = NULL;
...
if(t->is_Java_thread()) {
thread = (JavaThread*)t;
}
...
if (info != NULL && uc != NULL && thread != NULL) {
pc = (address) os::Linux::ucontext_get_pc(uc);
if (StubRoutines::is_safefetch_fault(pc)) {
```
As a result of this, using SafeFetch may crash non-JavaThreads if the location is invalid. E.g. using SafeFetch inside a VMOperation may crash the VM.
This is unfortunate since SafeFetch is used for os::is_readable_pointer() which explicitly promises to not crash. It is used e.g. in os::print_hex_dump(). There is also no reason why SafeFetch would not work for non-JavaThreads. In fact, SafeFetch handling for the secondary signal handler works just fine for all threads.
This is an old bug, unrelated to the recent Posix cleanups. AFAICS it has been there at least since Jdk11.
Attachments
Issue Links
- backported by
-
JDK-8267395 SafeFetch may crash if invoked in non-JavaThreads
-
- Resolved
-
-
JDK-8267437 SafeFetch may crash if invoked in non-JavaThreads
-
- Resolved
-
- relates to
-
JDK-8217994 os::print_hex_dump should be more resilient against unreadable memory
-
- Resolved
-
-
JDK-8185734 [Windows] Structured Exception Catcher missing around gtest execution
-
- Resolved
-
(1 links to)