-
Bug
-
Resolution: Fixed
-
P4
-
22.0.2
-
b26
-
generic
-
generic
-
Verified
A DESCRIPTION OF THE PROBLEM :
This code executes normally, although it shouldn't:
Linker linker = Linker.nativeLinker();
var padding = MemoryLayout.paddingLayout(1024).withByteAlignment(1024);
var sequence = MemoryLayout.sequenceLayout(4, padding);
var struct = MemoryLayout.structLayout(sequence);
var fd = FunctionDescriptor.of(struct, struct);
linker.downcallHandle(fd);
I think that's the problem here:
https://github.com/openjdk/jdk/blob/a8f143c6abe7669c232cabda3a4e8df726de036e/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java#L216
Because there are no additional checks on what is inside the SequenceLayout.
I highly recommend checking all the linker code related to SequenceLayout, because it seems for example for aarch64 the homogenous FP aggregate is incorrectly defined if ValueLayout are inside SequenceLayout
FREQUENCY : always
This code executes normally, although it shouldn't:
Linker linker = Linker.nativeLinker();
var padding = MemoryLayout.paddingLayout(1024).withByteAlignment(1024);
var sequence = MemoryLayout.sequenceLayout(4, padding);
var struct = MemoryLayout.structLayout(sequence);
var fd = FunctionDescriptor.of(struct, struct);
linker.downcallHandle(fd);
I think that's the problem here:
https://github.com/openjdk/jdk/blob/a8f143c6abe7669c232cabda3a4e8df726de036e/src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java#L216
Because there are no additional checks on what is inside the SequenceLayout.
I highly recommend checking all the linker code related to SequenceLayout, because it seems for example for aarch64 the homogenous FP aggregate is incorrectly defined if ValueLayout are inside SequenceLayout
FREQUENCY : always
- csr for
-
JDK-8340523 Native linker allows MemoryLayout consisting of only PaddingLayout
- Closed
- relates to
-
JDK-8344989 Test java/foreign/TestLinker.java failed with zero: IllegalStateException: libffi call failed with status: FFI_BAD_TYPEDEF
- Closed
-
JDK-8344954 Linker tests fails on BE platforms after JDK-8340205
- Resolved
- links to
-
Commit(master) openjdk/jdk/68ba7ee5
-
Review(master) openjdk/jdk/21041