gudzpoz opened a new issue, #2662: URL: https://github.com/apache/fory/issues/2662
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/fory/issues) and found no similar issues. ### Version OS: ArchLinux (6.16.7-zen1-1-zen) Fory: 'org.apache.fory:fory-core:0.12.3' Failing JDK: GraalVM 23.0.2+7.1 (build 23.0.2+7-jvmci-b01) ### Component(s) Java ### Minimal reproduce step Clone [the reproducer project](https://github.com/gudzpoz/fory-native-image-reproducer) Reproducing steps: ```console $ git checkout array-zeroing $ ./gradlew run # not native image: not zeroed [2, -1, -86, 2, -1, 11, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, -1, 16, 1, 15, 15, 15, 2, 15, 15, 15, 3, 15, 15, 15, 4, 15, 15, 15, -1, 16, 1, 0, -1, -1, 0, 0, -1, 15, 2, 0, -1, -1, 0, 0, -1, 15, -1, 16, 1, 15, 2, 15, 3, 15, 4, 15, 5, 15, 6, 15, 7, 15, 8, 15, -1, 64, 4, -1, 44, 4, 65, -1, 44, 4, 66] [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48] [3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848] [252645121, 252645122, 252645123, 252645124] [1152640033925038081, 1152640033925038082] [A, B] $ ./gradlew nativeCompile $ app/build/native/nativeCompile/test # native image [2, -1, -86, 2, -1, 11, 56, 57, 48, 0, 0, 0, 0, 0, 64, 56, 127, -1, 16, 3, 15, 15, 15, 4, 15, 15, 15, -64, -97, 120, 1, 2, 0, 0, 0, -1, 16, 2, 0, -1, -1, 0, 0, -1, 15, 0, 96, 122, 1, 2, 0, 0, 0, -1, 16, 5, 15, 6, 15, 7, 15, 8, 15, -128, -123, 126, 1, 4, 0, 0, 0, -1, 64, 4, -1, 44, 4, 65, -1, 44, 4, 66] [0, 0, 0, 0, 0, 0, 0, 0, 56, 57, 48] <---- note the initial zeros [0, 0, 0, 0, 3845, 3846, 3847, 3848] <---- note the initial zeros [0, 0, 252645123, 252645124] <---- note the initial zeros [0, 1152640033925038082] <---- note the initial zeros [A, B] ``` ### What did you expect to see? The elements in a primitive array are preserved after serialization-and-then-deserialization. ### What did you see instead? The initial eight bytes of `byte[]/short[]/int[]/long[]` seem to get zeroed. ### Anything Else? Here is [a GitHub action](https://github.com/gudzpoz/fory-native-image-reproducer/actions/runs/18002451137/job/51214783633) to reproduce under other JDK versions. (Expand the "Test" step for test output.) ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
