RFR: 8282306: os::is_first_C_frame(frame*) crashes on invalid link access

Christoph Langer clanger at openjdk.java.net
Wed Feb 23 15:42:53 UTC 2022


On Wed, 23 Feb 2022 14:59:49 GMT, Johannes Bechberger <duke at openjdk.java.net> wrote:

> This PR introduces a new method `can_access_link` into the frame class to check the accessibility of the link information. It furthermore adds a new `os::is_first_C_frame(frame*, Thread*)` that uses the `can_access_link` method
> and the passed thread object to check the validity of frame pointer, stack pointer, sender frame pointer and sender stack pointer. This should reduce the possibilities for crashes.

Changes requested by clanger (Reviewer).

src/hotspot/share/runtime/os.cpp line 1227:

> 1225:          !t->is_in_full_stack((address)fr->fp()) ||
> 1226:          !t->is_in_full_stack((address)fr->sender_sp()) ||
> 1227:          !t->is_in_full_stack((address)fr->link());

Should probably use
#ifdef _WINDOWS
...
#else
...
#endif

here

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

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


More information about the hotspot-dev mailing list