RFR: JDK-8257828: SafeFetch may crash if invoked in non-JavaThreads [v2]

Thomas Stuefe stuefe at openjdk.java.net
Mon Dec 14 05:24:57 UTC 2020


On Mon, 14 Dec 2020 04:44:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make SafeFetch work on Windows + AIX fix
>
> src/hotspot/os/windows/os_windows.cpp line 2258:
> 
>> 2256:   // Save pc in thread
>> 2257:   if (thread != nullptr && thread->is_Java_thread()) {
>> 2258:     thread->as_Java_thread()->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->PC_NAME);
> 
> Is this a full fix? If the thread is not a JavaThread we no longer hit a problem in as_Java_thread() but is doing nothing for a non-JavaThread actually the right thing to do?

The saved_exception_pc mechanism is only implemented for JavaThreads. But all threads go through the code below, where we change the pc in the context structure.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1695


More information about the hotspot-runtime-dev mailing list