Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8241764: [lworld] TestC2CCalls fails with SIGSEGV in frame::sender_for_compiled_frame #12

Closed
wants to merge 1 commit into from

Conversation

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Apr 2, 2020

Problem:
We crash during frame walking because the return address on the stack is incorrect. The stack slot containing the return address was accidentally overwritten when packing value type arguments in the scalarized entry of C1 compiled code. The problem is that even after extending the stack, the same slot that contains the return address might be used for an argument and is therefore overwritten. C2 has "reserved entries" to account for that.

Solution:
C1 does not have a reserved stack slot for the return address and we therefore shouldn't reuse the callers frame when packing. Always extend the stack enough for packing to have its "own" stack space to lay out arguments. This wastes some stack space but is much simpler than the "reserved entries" solution applied by C2.

I've modified the C2CCalls test to reliable reproduce this issue by sometimes only compiling some methods with C1. Also did lots of refactoring in preparation of "Calling Convention 2.0". One goal is to get rid of "reserved entries" in C2 as well.


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8241764: [lworld] TestC2CCalls fails with SIGSEGV in frame::sender_for_compiled_frame

Download

$ git fetch https://git.openjdk.java.net/valhalla pull/12/head:pull/12
$ git checkout pull/12

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 2, 2020

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 2, 2020

@TobiHartmann This change now passes all automated pre-integration checks, type /integrate in a new comment to proceed. After integration, the commit message will be:

8241764: [lworld] TestC2CCalls fails with SIGSEGV in frame::sender_for_compiled_frame
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

➡️ To integrate this PR with the above commit message, type /integrate in a new comment.

@TobiHartmann
Copy link
Member Author

@TobiHartmann TobiHartmann commented Apr 2, 2020

/test

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 2, 2020

Webrevs

@openjdk
Copy link

@openjdk openjdk bot commented Apr 2, 2020

A test job has been started with id: github.com-182025808-12-607883427

@openjdk
Copy link

@openjdk openjdk bot commented Apr 2, 2020

@TobiHartmann your test job with id github.com-182025808-12-607883427 for commits up until cdd6ded has finished.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 3, 2020

Mailing list message from Roland Westrelin on valhalla-dev:

Webrev: https://webrevs.openjdk.java.net/valhalla/12/webrev.00

Ok.

Roland.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 3, 2020

Mailing list message from Tobias Hartmann on valhalla-dev:

Thanks Roland!

Best regards,
Tobias

On 03.04.20 09:56, Roland Westrelin wrote:

Webrev: https://webrevs.openjdk.java.net/valhalla/12/webrev.00

Ok.

Roland.

@TobiHartmann
Copy link
Member Author

@TobiHartmann TobiHartmann commented Apr 3, 2020

/integrate

@openjdk openjdk bot closed this Apr 3, 2020
@openjdk openjdk bot added integrated and removed ready labels Apr 3, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Apr 3, 2020

@TobiHartmann
Pushed as commit a264ae9.

@openjdk openjdk bot removed the rfr label Apr 3, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 3, 2020

Mailing list message from Tobias Hartmann on valhalla-dev:

Changeset: a264ae9
Author: Tobias Hartmann <thartmann at openjdk.org>
Date: 2020-04-03 10:17:04 +0000
URL: https://git.openjdk.java.net/valhalla/commit/a264ae9a

8241764: [lworld] TestC2CCalls fails with SIGSEGV in frame::sender_for_compiled_frame

! src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
! src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
! src/hotspot/cpu/x86/frame_x86.cpp
! src/hotspot/cpu/x86/macroAssembler_x86.cpp
! src/hotspot/cpu/x86/macroAssembler_x86.hpp
! src/hotspot/cpu/x86/x86_64.ad
! src/hotspot/share/asm/macroAssembler_common.cpp
! src/hotspot/share/asm/macroAssembler_common.hpp
! src/hotspot/share/c1/c1_LIRAssembler.cpp
! src/hotspot/share/c1/c1_MacroAssembler.hpp
! test/hotspot/jtreg/compiler/valhalla/valuetypes/TestC2CCalls.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant