BoxFort icon indicating copy to clipboard operation
BoxFort copied to clipboard

Test failures on RISC-V

Open jsmolic opened this issue 10 months ago • 3 comments

Hi, I'm trying to add support for RISC-V to boxfort in Gentoo. I've backported c91d7181734ab2fd6d1299e8aa927297f0ddb754 into our package, the compilation phase looks fine, however I ran into two test failures:

==================================== 3/5 =====================================
test:         context.c
start time:   18:17:36
duration:     0.38s
result:       killed by signal 6 SIGABRT
command:      UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=166 MSAN_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 /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/boxfort-0.1.4-build/sample/context.c.bin
==============================================================================

==================================== 4/5 =====================================
test:         cram tests
start time:   18:17:36
duration:     0.79s
result:       exit status 1
command:      PATH=/var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/boxfort-0.1.4-build/test/../sample:/var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/boxfort-0.1.4-build/test/../sample:/var/tmp/portage/dev-libs/boxfort-0.1.4-r1/temp/python3.12/bin:/usr/lib/portage/python3.12/ebuild-helpers/xattr:/usr/lib/portage/python3.12/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/usr/lib/llvm/19/bin:/usr/lib/llvm/18/bin:/usr/lib/llvm/15/bin LC_ALL=en_US.utf8 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=40 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MSYS2_ARG_CONV_EXCL=--filter= ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 TERM=dumb MESON_TEST_ITERATION=1 /usr/bin/cram --shell=/usr/bin/sh /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/BoxFort-0.1.4/test/cram
----------------------------------- stdout -----------------------------------
!
--- /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/BoxFort-0.1.4/test/cram/core.t
+++ /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/BoxFort-0.1.4/test/cram/core.t.err
@@ -12,5 +12,5 @@
 Testing if the context sample behave as expected
 
   $ context.c.bin
-  my_int = 42
-  my_long = 24
+  /usr/bin/sh: line 6:  2553 Aborted                 (core dumped) context.c.bin
+  [134]

# Ran 1 tests, 0 skipped, 1 failed.
==============================================================================

==================================== 5/5 =====================================
test:         timeout.c
start time:   18:17:36
duration:     2.03s
result:       exit status 0
command:      MALLOC_PERTURB_=3 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MSAN_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 /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/boxfort-0.1.4-build/sample/timeout.c.bin
----------------------------------- stdout -----------------------------------
Wait timed out after 1 second
Process killed after 2.0 seconds
==============================================================================


Summary of Failures:

3/5 context.c  FAIL            0.38s   killed by signal 6 SIGABRT
4/5 cram tests FAIL            0.79s   exit status 1

Ok:                 3   
Expected Fail:      0   
Fail:               2   
Unexpected Pass:    0   
Skipped:            0   

I'll try to run using gdb later to get more info about this, in the meantime I'll also upload full build and test log.

jsmolic avatar Feb 18 '25 18:02 jsmolic

sh-5.2# strace ./context.c.bin
execve("./context.c.bin", ["./context.c.bin"], 0x3fe586ee70 /* 34 vars */) = 0
brk(NULL)                               = 0x2b156bd000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=50130, ...}) = 0
mmap(NULL, 50130, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3fbb10e000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\264y\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1408968, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3fbb10c000
mmap(NULL, 1432576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3fbafae000
mmap(0x3fbb100000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x152000) = 0x3fbb100000
mmap(0x3fbb105000, 27648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3fbb105000
close(3)                                = 0
set_tid_address(0x3fbb10cdb0)           = 11558
set_robust_list(0x3fbb10cdc0, 24)       = 0
mprotect(0x3fbb100000, 12288, PROT_READ) = 0
mprotect(0x2ad863f000, 4096, PROT_READ) = 0
mprotect(0x3fbb13f000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x3fbb10e000, 50130)             = 0
getrandom("\x4c\xcf\x7a\x2f\x0c\xfd\x62\x07", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x2b156bd000
brk(0x2b156de000)                       = 0x2b156de000
getpid()                                = 11558
openat(AT_FDCWD, "/dev/shm/bxf_arena_11558", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0600) = 3
unlinkat(AT_FDCWD, "/dev/shm/bxf_arena_11558", 0) = 0
ftruncate(3, 131072)                    = 0
mincore(0x4a517f000000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f001000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f002000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f003000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f004000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f005000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f006000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f007000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f008000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f009000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00a000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00b000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00c000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00d000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00e000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f00f000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f010000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f011000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f012000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f013000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f014000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f015000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f016000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f017000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f018000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f019000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01a000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01b000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01c000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01d000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01e000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mincore(0x4a517f01f000, 4096, 0x3fe96fbb07) = -1 ENOMEM (Cannot allocate memory)
mmap(0x4a517f000000, 131072, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0) = -1 ENOMEM (Cannot allocate memory)
close(3)                                = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 11558
getpid()                                = 11558
tgkill(11558, 11558, SIGABRT)           = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=11558, si_uid=0} ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)

jsmolic avatar Feb 21 '25 17:02 jsmolic

sh-5.2# gdb --args ./context.c.bin
GNU gdb (Gentoo 16.2 vanilla) 16.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "riscv64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./context.c.bin...
(gdb) run
Starting program: /var/tmp/portage/dev-libs/boxfort-0.1.4-r1/work/boxfort-0.1.4-build/sample/context.c.bin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".

Program received signal SIGABRT, Aborted.
0x0000003ff7eda2c8 in ?? () from /usr/lib64/libc.so.6
(gdb) bt
#0  0x0000003ff7eda2c8 in ?? () from /usr/lib64/libc.so.6
#1  0x0000003ff7ea21c4 in raise () from /usr/lib64/libc.so.6
#2  0x0000003ff7e923ca in abort () from /usr/lib64/libc.so.6
#3  0x0000002aaaaabf3e in main () at ../BoxFort-0.1.4/sample/context.c:33

jsmolic avatar Feb 21 '25 17:02 jsmolic