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

Martin Doerr mdoerr at openjdk.java.net
Mon Mar 21 10:35:27 UTC 2022


On Tue, 15 Mar 2022 07:54:23 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.
>
> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add workaround comment

Looks good except minor nits.

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

> 1181: // Looks like all platforms can use the same function to check if C
> 1182: // stack is walkable beyond current frame.
> 1183: // Returns false if this is the cas

Rest of comment missing.

test/hotspot/gtest/runtime/test_os.cpp line 871:

> 869: 
> 870: TEST_VM(os, is_first_C_frame) {
> 871:   #ifndef _WIN32

Spaces before `#` should ideally be avoided: https://stackoverflow.com/questions/4721978/should-preprocessor-instructions-be-on-the-beginning-of-a-line
(I guess not really a problem for the compilers we use.)

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

Changes requested by mdoerr (Reviewer).

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


More information about the hotspot-dev mailing list