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
8273373: Zero: Cannot invoke JVM in primordial threads on Zero #5376
Conversation
|
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Aleksey,
The assert in the shared code seems fine. I can't really comment on the Zero changes and the dropping of IA64 support here.
Thanks,
David
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I do not see a reason why this would be dependent on !zero. Maybe @GoeLin did not want to deal with it, or the problem did not show up on zero in the first place.
I think you are right in that gtestlauncher is the only launcher where we end up running in the primordial thread.
Removing ia64 code block is fine. Arguably zero may be the last variant where ia64 would still be useful. Debian seems still to build Zero+ia64 in openjdk15: https://buildd.debian.org/status/logs.php?pkg=openjdk-15&arch=ia64
About the zero gtest errors, do you understand why they only happen in other_vm resp. death tests? Something must be special here. I am curious since invoking JNI on the primordial thread may not be that well tested.
I tried to understand the primordial-thread-stack-boundaries coding, but it left a number of questions. For instance we try to find the primordial stack dimensions by:
- read /proc/self/stat, column 28 ("stackstart", bottom address)
- then we go and find the VMA containing this address, and assume the highest address of this VM is the stack top.
I am not sure the latter always works. Is that not dependent on memory layout? It relies on the process stack having its own VMA, but could the kernel not fold it with a neighboring VMA and show it as one line in /proc/self/maps? In that case, the stack start address we calculate could be bogus.
I got curious and analyzed this further. Let's see if I got this correctly. When we create the VM on the primordial thread, we locate the stack boundaries for the primordial thread in There, we basically look for the boundaries of the primordial thread stack in Seems that that assumed stack size can be smaller than the real size of the stack, resulting in an offset between the real stack VMA low address and That in itself would be not a problem, but in In Bottomline, we should either be using There are a number of additional beauty spots, like the fact that in Also, I don't understand the logic in I would probably rename the issue to "Cannot invoke JVM in primordial threads on Zero". Cheers, Thomas |
Yes, that seems to be the gist of it. In fact, if I reply |
I looked around Debian's support for IA64, and I think we don't want to drop the support for it just yet. Zero VM is one of those last stands for weird arches portability :) Instead of adding the |
Yes, and zero also needs Goetz' fix for the glibc guard size problem in JDK-8169373. |
I'd be surprised if it still works in JDK 18 though. The latest they build is 15. ia64 breaks so easily, and no one took care of it in the recent past. |
Yes, but I also want the fix to be backportable to JDK 11. Which means I should probably keep whatever IA64 support there is. I'll figure this out. |
Oh right. Makes sense. |
I pushed the most conservative version I could think of now. Debian folks seem to also patch this method for HPPA: it seems to have unusual stack arrangements too, so I left the original method body as untouched as possible. This still makes gtests happier for Zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@shipilev This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
Thank you! /integrate |
Going to push as commit 0f31d0f.
Your commit was automatically rebased without conflicts. |
See the bug for more discussion.
Additional testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5376/head:pull/5376
$ git checkout pull/5376
Update a local copy of the PR:
$ git checkout pull/5376
$ git pull https://git.openjdk.java.net/jdk pull/5376/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5376
View PR using the GUI difftool:
$ git pr show -t 5376
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5376.diff