apnadkarni / tcl-cffi

A Foreign Function Interface extension for Tcl
BSD 2-Clause "Simplified" License
15 stars 2 forks source link

Test failures on Risc-V running Debian #211

Closed PaulObermeier closed 1 month ago

PaulObermeier commented 1 month ago

If interested in Risc-V, here are the test results. I'm using a StarFive VisionFive2.

testResultsRiscV-Tcl8.6.15.txt testResultsRiscV-Tcl9.0.0.txt

apnadkarni commented 1 month ago

Thanks, Paul. All test failures seem to pertain to char field in a struct.

What version of Linux, libffi and gcc? Trying to match against tickets in libffi before looking further. Only way to debug would be to install qemu and that feels like too much work related to other priorities :-(

Can you let me know the output as follows:

% cffi::Struct create S {c schar i int}
::S
% S info
Size 8 Alignment 4 Flags 0 Fields {c {Size 1 Offset 0 Definition schar} i {Size 4 Offset 4 Definition int}}
% cffi::type info schar
Size 1 Count -1 Alignment 1 Definition schar BaseSize 1
apnadkarni commented 1 month ago

Managed to get Debian trixie installed on a QEMU Risc-V emulator. So some change of debugging this...

apnadkarni commented 1 month ago

And able to reproduce the failures.

apnadkarni commented 1 month ago

Thanks for reporting this. As it turns out the test function was using CHAR_MIN instead of SCHAR_MIN and would have failed on all builds where char was unsigned.

Tests ended at Tue Oct 08 15:42:45 UTC 2024
all.tcl:        Total   10894   Passed  10535   Skipped 359     Failed  0
Sourced 16 Test Files.
Number of tests skipped for each constraint:
        13      !structbyval
        3       !structbyval packsupport
        1       disabled
        25      dyncall
        316     win
        1       win32
debian@debian:~/src/tcl-cffi/build$ uname -a
Linux debian 6.8.12-riscv64 #1 SMP Debian 6.8.12-1 (2024-05-31) riscv64 GNU/Linux
PaulObermeier commented 1 month ago

Tests run fine now.