-
Notifications
You must be signed in to change notification settings - Fork 127
8370479: [lworld] OOP-related crashes via mvn surefire #1713
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
Closed
+131
−3
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a74e352
Fix oop error printing bug.
Arraying ab3ed8a
Update Access API to not check uninitialized memory.
Arraying 03c4fdb
Add test.
Arraying 9df8d58
Clean up test.
Arraying f9a93d3
Improve flat array copying test.
Arraying 18472fd
Rework the G1 barrier model with flat oops.
Arraying File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
test/hotspot/jtreg/runtime/valhalla/inlinetypes/FlatArrayCopyingTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /* | ||
| * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| * or visit www.oracle.com if you need additional information or have any | ||
| * questions. | ||
| * | ||
| */ | ||
|
|
||
| /* | ||
| * @test id=serial | ||
| * @summary Ensures that value arrays can get arraycopied properly with Serial. | ||
| * This test will likely crash if that is not the case. | ||
| * @bug 8370479 | ||
| * @enablePreview | ||
| * @requires vm.flagless | ||
| * @library /test/lib / | ||
| * @modules java.base/jdk.internal.value | ||
| java.management | ||
| * @build jdk.test.whitebox.WhiteBox | ||
| * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox | ||
| * @run junit/othervm/timeout=480 -Xint -XX:+UseSerialGC -XX:+UseCompressedOops -Xlog:gc*=info | ||
| -XX:+UseCompressedClassPointers | ||
| -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI | ||
| runtime.valhalla.inlinetypes.FlatArrayCopyingTest | ||
| */ | ||
|
|
||
| /* | ||
| * @test id=parallel | ||
| * @summary Ensures that value arrays can get arraycopied properly with Parallel. | ||
| * This test will likely crash if that is not the case. | ||
| * @bug 8370479 | ||
| * @enablePreview | ||
| * @requires vm.flagless | ||
| * @library /test/lib / | ||
| * @modules java.base/jdk.internal.value | ||
| java.management | ||
| * @build jdk.test.whitebox.WhiteBox | ||
| * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox | ||
| * @run junit/othervm/timeout=480 -Xint -XX:+UseParallelGC -XX:+UseCompressedOops -Xlog:gc*=info | ||
| -XX:ParallelGCThreads=1 -XX:-UseDynamicNumberOfGCThreads | ||
| -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI | ||
| runtime.valhalla.inlinetypes.FlatArrayCopyingTest | ||
| */ | ||
|
|
||
| /* | ||
| * @test id=g1 | ||
| * @summary Ensures that value arrays can get arraycopied properly with G1. | ||
| * This test will likely crash if that is not the case. | ||
| * @bug 8370479 | ||
| * @enablePreview | ||
| * @requires vm.flagless | ||
| * @library /test/lib / | ||
| * @modules java.base/jdk.internal.value | ||
| java.management | ||
| * @build jdk.test.whitebox.WhiteBox | ||
| * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox | ||
| * @run junit/othervm/timeout=480 -Xint -XX:+UseG1GC -XX:+UseCompressedOops -Xlog:gc*=info | ||
| -XX:ParallelGCThreads=1 -XX:ConcGCThreads=1 -XX:-UseDynamicNumberOfGCThreads | ||
| -XX:-G1UseConcRefinement -XX:+UseCompressedClassPointers | ||
| -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI | ||
| runtime.valhalla.inlinetypes.FlatArrayCopyingTest | ||
| */ | ||
|
|
||
| package runtime.valhalla.inlinetypes; | ||
|
|
||
| import java.util.Arrays; | ||
| import jdk.internal.value.ValueClass; | ||
| import org.junit.jupiter.api.Assertions; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import jdk.test.whitebox.WhiteBox; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| public final class FlatArrayCopyingTest { | ||
| private static final WhiteBox WB = WhiteBox.getWhiteBox(); | ||
|
|
||
| public static value record Element(Identity underlying) {} | ||
| public static class Identity {} | ||
|
|
||
| @Test | ||
| public void testCopyingOften() { | ||
| Object[] array = ValueClass.newNullableAtomicArray(Element.class, 16); | ||
| for (int i = 0; i < 1_000_000; i++) { | ||
| if (i == array.length) { | ||
| array = Arrays.copyOf(array, array.length << 1); | ||
| } | ||
| // Do a very "random" full GC. | ||
| if (i == 5123123) { | ||
| WB.fullGC(); | ||
| } | ||
| array[i] = new Element(new Identity()); | ||
| } | ||
| // Smallest power of 2 that fits 1 million elements. | ||
| assertEquals(1_048_576, array.length); | ||
| } | ||
|
|
||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you make a small upstream patch for this in mainline (either in addition or instead of this part of the change?)
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.
Sure, I'll do it separately, I want to get this fixed in Valhalla ASAP.