janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.54k stars 228 forks source link

Janet tests fail on S390x #1497

Closed bkmgit closed 2 months ago

bkmgit commented 2 months ago

When building for Fedora Linux:

3/29 test/suite-buffer.janet   FAIL            0.04s   exit status 1
>>> LD_LIBRARY_PATH=/builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/ UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MESON_TEST_ITERATION=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=5 /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/janet /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stderr:
Starting suite /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet...
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:82: "buffer/push-uint16 big endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:86: "buffer/push-uint16 little endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:96: "buffer/push-uint32 big endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:100: "buffer/push-uint32 little endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:108: "buffer/push-float32 big endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:112: "buffer/push-float32 little endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:116: "buffer/push-float64 big endian": false
✘ /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet:120: "buffer/push-float64 little endian": false
Finished suite /builddir/build/BUILD/janet-1.35.2-build/janet-1.35.2/redhat-linux-build/../test/suite-buffer.janet in 0.021 seconds - 49 of 57 tests passed.

Full log https://kojipkgs.fedoraproject.org//work/tasks/3385/123023385/build.log

bakpakin commented 2 months ago

Thanks @bkmgit , looked into it.

Looks as though we were using some union tricks to copy words and switch endianness rather than just use memcpy. Simplifying the code there and using memcpy fixes the issues. I've also added s390x to the possible values for os/arch and added it to our CI.

Fixed as of e9deec8231c0d1f99a8f1615b6cefdd493da4411, closing.

bkmgit commented 2 months ago

@bakpakin Thanks for the quick fix.