Open tianon opened 1 year ago
Looks like the same issues with the C++ interface that bother rocksdb an hdt. Work is going on to resolve these issues using a better designed C++ interface. In the meanwhile I propose to disable space in the same way.
Looks like it's hdt
causing problems now: :eyes:
mkdir -p lib/armv8l-linux
g++ -shared -o lib/armv8l-linux/hdt4pl.so c/hdt4pl.o -Lc -lhdt -lcds -lserd-0
gmake: Nothing to be done for 'install'.
/usr/lib/swipl/bin/armv8l-linux/swipl -g test_hdt -t halt test/test_hdt.pl
% Start unit: hdt
% [1/1] hdt:hdt_search_id ..Reading: 4 Read: 767
....................... **FAILED (0.010 sec)
ERROR: /usr/share/swi-prolog/pack/hdt/test/test_hdt.pl:20:
ERROR: ERROR: test hdt:hdt_search_id: received error: HDT: Could not read the expected bytes from input
% End unit hdt: **FAILED (0.013 sec CPU)
ERROR: 1 test failed
% 0 tests passed
% % Test run completed in 0.020 seconds (0.020 cpu)
ERROR: -g test_hdt: false
gmake: *** [Makefile:42: check] Error 1
ERROR: -g pack_rebuild(hdt): Process "process(/usr/bin/gmake,[check])": exit status: 2
Which Prolog version and version of the pack are we talking about?
Has the first problem (compilation errors in pack space
) gone away and there's a new problem, namely the test failure in pack hdt
?
Can I assume that the build+test is done from a clean image?
Is this a problem only with arm32v7 (or armv8l?) or does it show in other images?
Which version of SWI-Prolog and version of hdt? (that is, which commit in git@github.com:JanWielemaker/hdt.git and git@github.com:SWI-Prolog/swipl-devel.git)
And we might need to know the versions of libserd-dev
or serd-devel
because this appears to be an error message from one of those, that is being reported via the Prolog test.
Both latest and stable are currently failing (docker buildx build --platform linux/arm/v7 https://github.com/SWI-Prolog/docker-swipl.git#4c15bb03b82ab39fb3bdf6579ad66014111faa11:9.3.9/bookworm
and docker buildx build --platform linux/arm/v7 https://github.com/SWI-Prolog/docker-swipl.git#4c15bb03b82ab39fb3bdf6579ad66014111faa11:9.2.6/bookworm
).
So that's:
and
(as you can see in that Dockerfile
, the previous issues with space
don't currently apply because the line that installs space
is commented out completely, but even if it weren't, it excludes armhf
/ arm32v7
explicitly :sweat_smile:)
This is not the latest version of hdt
, so changing to commit 18c3a52fe4d094f8f19a9571896d9a8273e44fe7 might fix things.
The space
commit seems to be the latest, so that might fix the original reported problem (from over a year ago); perhaps uncomment line 72?
(The decision on these needs to be made by @JanWielemaker -- I merely updated the packs to use the new C++ API)
I ended up going slightly newer in the history on hdt
(https://github.com/JanWielemaker/hdt/commit/f6a5f746949ab5a150cce4e47b45049cefd18e8a) because the commits after https://github.com/JanWielemaker/hdt/commit/18c3a52fe4d094f8f19a9571896d9a8273e44fe7 seemed pretty sane:
diff --git a/9.3.9/bookworm/Dockerfile b/9.3.9/bookworm/Dockerfile
index 755954a..3a44b32 100644
--- a/9.3.9/bookworm/Dockerfile
+++ b/9.3.9/bookworm/Dockerfile
@@ -69,7 +69,7 @@ RUN set -eux; \
# libgeos-dev of Debian bookworm is broken: the library does not define the Coordinate constructors nor the inline code to avoid calling these.
# [ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin space https://github.com/JanWielemaker/space.git 097687c7b67902704b03f095cc2f1e9.3.91e700; \
[ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin rocksdb https://github.com/JanWielemaker/rocksdb.git a63f1f5650e44c7d40401ed5a8b689aa1caca635; \
- install_addin hdt https://github.com/JanWielemaker/hdt.git 7f2221747ea751a20ad0d7b95aebfd2c99649c1f; \
+ install_addin hdt https://github.com/JanWielemaker/hdt.git f6a5f746949ab5a150cce4e47b45049cefd18e8a; \
[ "$dpkgArch" = 'armhf' ] || [ "$dpkgArch" = 'armel' ] || install_addin rserve_client https://github.com/JanWielemaker/rserve_client.git bdf8962264d65dd8ef6eedf5f00ff0c0f6c52c2f; \
apt-get purge -y --auto-remove $BUILD_DEPS
CMD ["swipl"]
This builds fine on amd64 and arm64, but on arm32 (v7), it still fails like this:
/usr/bin/gmake check-TESTS
gmake[4]: Entering directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[5]: Entering directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
PASS: c11
PASS: bitutiltest
PASS: listener
PASS: streamtest
PASS: bit375
% PASS: testmax
PASS: properties
% PASS: serd
PASS: logarr
../../build/test-driver: line 112: 69560 Aborted (core dumped) "$@" >> "$log_file" 2>&1
FAIL: dumpDictionary
FAIL: dictionaries
../../build/test-driver: line 112: 69569 Aborted (core dumped) "$@" >> "$log_file" 2>&1
============================================================================
% Testsuite summary for libhdt 1.3.3
% ============================================================================
% # TOTAL: 11
% # PASS: 9
# SKIP: 0
% # XFAIL: 0
% # FAIL: 2
% # XPASS: 0
% # ERROR: 0
% ============================================================================
See libhdt/tests/test-suite.log
% Please report to some@email.com
% ============================================================================
gmake[5]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[5]: *** [Makefile:822: test-suite.log] Error 1
gmake[4]: *** [Makefile:930: check-TESTS] Error 2
gmake[4]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[3]: *** [Makefile:1073: check-am] Error 2
gmake[3]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[2]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt'
gmake[2]: *** [Makefile:1656: check-recursive] Error 1
gmake[1]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp'
gmake[1]: *** [Makefile:432: check-recursive] Error 1
% gmake: *** [Makefile:49: check] Error 2
ERROR: -g pack_rebuild(hdt): Process "process(/usr/bin/gmake,[check])": exit status: 2
However, this does look healthier than the error we were getting before, so it's at least possible this is QEMU user-mode emulation related and might be worth trying on actual hardware.
Unfortunately the failure looks the same on native Arm hardware:
/usr/bin/gmake check-TESTS
gmake[4]: Entering directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[5]: Entering directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
PASS: listener
PASS: bit375
PASS: c11
PASS: serd
PASS: streamtest
PASS: properties
PASS: logarr
../../build/test-driver: line 112: 26485 Aborted (core dumped) "$@" >> "$log_file" 2>&1
FAIL: dictionaries
PASS: testmax
PASS: bitutiltest
../../build/test-driver: line 112: 26606 Aborted (core dumped) "$@" >> "$log_file" 2>&1
FAIL: dumpDictionary
============================================================================
% Testsuite summary for libhdt 1.3.3
% ============================================================================
# TOTAL: 11
% # PASS: 9
% # SKIP: 0
# XFAIL: 0
# FAIL: 2
# XPASS: 0
# ERROR: 0
% ============================================================================
% See libhdt/tests/test-suite.log
Please report to some@email.com
% ============================================================================
gmake[5]: *** [Makefile:822: test-suite.log] Error 1
gmake[5]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[4]: *** [Makefile:930: check-TESTS] Error 2
gmake[4]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[3]: *** [Makefile:1073: check-am] Error 2
gmake[3]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt/tests'
gmake[2]: *** [Makefile:1656: check-recursive] Error 1
gmake[2]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp/libhdt'
gmake[1]: *** [Makefile:432: check-recursive] Error 1
gmake[1]: Leaving directory '/usr/share/swi-prolog/pack/hdt/hdt-cpp'
gmake: *** [Makefile:49: check] Error 2
ERROR: -g pack_rebuild(hdt): Process "process(/usr/bin/gmake,[check])": exit status: 2
Looking at hdt
, I see that the official package (at https://www.swi-prolog.org/pack/list?p=hdt) uses the release from 2023-12-18; the docker image uses 2024-07-12; and the last update in GitHub was 2024-07-14. So, it's possible that the problem has been fixed in the interim (for example, there has been an update to the submodule hdt-cpp
).
I still have a few more small-ish changes to make to the hdt
package -- I probably won't be able to do them for another week or two ... I'm hoping that this is OK.
In the meantime, is there any way for me to try things out on an ARM machine (or emulator)? And is it only the 32-bit ARM builds that have the problem? (If so, should we even support 32-bit?)
(I think that there are similar version mis-matches for packages space
, rserver_client
and rocksdb
... I intend to do my final small changes to them at the same time as the hdt
package, and then @JanWielemaker can set the packages and docker images to the latest commits.)
In the meantime, is there any way for me to try things out on an ARM machine (or emulator)?
Yes! I only tried on real hardware because segfault is one of those behaviors that is often the result of not emulating the architecture correctly, but the issue reproduces the same on real hardware, so emulation should be fine to reproduce. :smile:
I use the qemu-user-static
package installed on my (Debian) host, which uses the kernel's binfmt
support to install the user-mode emulator such that I can then transparently run "foreign" architecture Docker containers without issue. Docker Desktop (on all platforms) does a similar setup by default IIRC. My experience is that this is usually good enough for testing things, but be warned it does often have quirks that can only be overcome by doing full system-mode emulation (ie, full emulated VM) or running on native hardware. :sweat_smile:
And is it only the 32-bit ARM builds that have the problem? (If so, should we even support 32-bit?)
Yeah, as far as I can tell it's only 32bit Arm builds -- the primary audience for these would be anyone on a Raspberry Pi (or similar hardware from other vendors), although we're now down to just v7 so only Raspberry Pi 2+ (no Pi1 or Pi0), and Pi3+ is technically an arm64 system so users can/arguably should be running a 64bit OS on those.
In general, the audience for 32bit Arm does seem to be shrinking, but slowly, and they tend to be vocal to an outsized degree. However, that being said, I don't know whether there's much demand for the swipl
image specifically on these platforms (as evidenced by the lack of anyone but me and y'all even reacting to this issue/thread :smile:).
At least one of the error messages appears (at first glance) to be from the underlying code that is merely wrapped by SWI-Prolog, so fixing that might be beyond my capabilities.
I would vote for simply disabling the three packages for 32-bit Raspberry Pi, as unlikely to be used there; and if someone does want one of those packages, there's a straightforward mechanism for installing it (although it might not work, of course). @JanWielemaker - what do you think? Is there something special about HDT, space, rserver_client, that only they are included in the images and not any of the other packages?
When building on
arm32v7
, the official servers are running into build failures -- here's a snippet of the relevant logs: