Comments (4)
The AIX compiler leaves us in a difficult position. We need to support types which use the default (power?) alignment rules as well as "natural" alignment. I don't think we should undo the fixes we've made to handle the default alignment rules.
I agree those pragma lines should be removed, unless tests specifically account for the non-default alignment.
from openj9.
It is weird that the issue with downcall or upcall at #18941, #18942, #18943 never occurred on other platforms or in JDK21. It is most likely something new happens to the JD22 test suites or something else we were unaware of before on AIX.
from openj9.
The crash was triggered by the following code that was added recently in test to enforce the 8-byte alignment for double
in struct at https://github.com/ibmruntimes/openj9-openjdk-jdk22/blob/687a1453366566440768237f7c69361b2ec21406/test/jdk/java/foreign/shared.h#L37
#ifdef _AIX
#pragma align (natural) <-------------
#endif
...
#ifdef _AIX
#pragma align (reset) <-------------
#endif
as mentioned at the new code on AIX at https://github.com/ibmruntimes/openj9-openjdk-jdk22/blob/687a1453366566440768237f7c69361b2ec21406/src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/aix/AixPPC64Linker.java#L60
protected void checkStructMember(MemoryLayout member, long offset) {
// special case double members that are not the first member
// see: https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=data-using-alignment-modes <-----
// Note: It is possible to enforce 8-byte alignment by #pragma align (natural)
// Therefore, we use normal checks if we are already 8-byte aligned.
if ((offset % 8 != 0) && (member instanceof ValueLayout vl && vl.carrier() == double.class)) {
if (vl.byteAlignment() != 4) {
throw new IllegalArgumentException("double struct member " + vl + " at offset " + offset + " should be 4-byte aligned");
}
if (vl.order() != linkerByteOrder()) {
throw new IllegalArgumentException("double struct member " + vl + " at offset " + offset + " has an unexpected byte order");
}
} else {
super.checkStructMember(member, offset);
}
}
which conflicts with our previous changes in OpenJDK at https://github.com/ibmruntimes/openj9-openjdk-jdk22/blob/687a1453366566440768237f7c69361b2ec21406/src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java#L292
public static OfDouble of(ByteOrder order) {
return new OfDoubleImpl(order, Utils.IS_AIX ? 4 : ADDRESS_SIZE_BYTES, Optional.empty()); <---------
}
@Override
public boolean hasNaturalAlignment() {
return Utils.IS_AIX ? (byteAlignment() == 4) : super.hasNaturalAlignment(); <--------
}
}
As discussed at #18287 (comment), we should always allow the default setting by the compiler and never assume that users are aware of the platform-specific difference by imposing #pragma
in the applications for AIX.
To address the issue with alignment on double
on AIX, I'd suggest to remove the #pragma
related test code in the test header file without any modification in our code as to the 4-byte alignment adjustment on double
.
FYI: @keithc-ca
from openj9.
Close the issue as resolved via ibmruntimes/openj9-openjdk-jdk22#32.
from openj9.
Related Issues (20)
- JEP 472: Prepare to Restrict the Use of JNI HOT 2
- jdk_security3_0_FAILED sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java Exception: Client: Data length error HOT 1
- serviceability_jvmti_j9_1_FAILED serviceability/jvmti/thread/GetStackTrace/getstacktr07/getstacktr07.java Fatal error: SetBreakpoint failed HOT 10
- Fix disabled tests in ValueTypeTests
- OpenJDK VarHandleTest expected object to not be null HOT 2
- jdk22 doesn't work to boot jdknext on xmac - Failed to load library libawt.dylib HOT 1
- Jenkins test job failure: MultipleCompilationErrorsException: startup failed HOT 2
- How can I avoid a hang on error during CRIU checkpoint?
- [zOS S390] 80 JVM_Functionality.RAS Trace Non-Smoke.Mode110.1 ArrayIndexOutOfBoundsException: Array index out of range: 0 at com.ibm.trace.tests.apptrace.TestJavaCoreAndSnap.main(TestJavaCoreAndSnap.java:36) & Trace point lines did not match:j9mm.668 vs base HOT 13
- Access to rh8-390-2 for debugging HOT 3
- Fix tests in disabled variations of ValueTypeTestsJIT HOT 1
- jdk_lang_VarHandleTest_j9_1_FAILED java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java AssertionError: No throwable thrown. Expected class java.nio.ReadOnlyBufferException expected object to not be null HOT 1
- [FFI] Avoid creating duplciate ffi_types for the same structs in preparing the cif data for downcall HOT 1
- Improve UnsafeFastPath to use a constant value if offset node is a loadConst node
- OpenJDK java/foreign/largestub/TestLargeStub IncompatibleClassChangeError
- [linux_390] SE80_GIT decompileAtMethodResolve_0 Illegal instruction vmState=0x00000000 at Compiled_method=com/ibm/jvmti/tests/decompileAtMethodResolve/ResolveTest1Super.test()V HOT 1
- MathLoadTest_autosimd_special_5m_27 hang or slow waiting to be notified on: "JIT-QueueSlotMonitor-3"
- jdk_lang_1_FAILED java/lang/ProcessBuilder/PipelineLeaksFD.java AssertionError: More or fewer pipes than expected HOT 3
- [Windows IA32] 80 FVT_Serviceability.diagnostics.xdump_gpf_javacore.Mode121.1 gpf test failed Access Violations(s) detected in std_AnalyseDTFJJavacore.out HOT 2
- OpenJDK java/util/concurrent/ExecutorService/InvokeTest AssertionFailedError: invokeAll did not throw
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openj9.