Created attachment 795242 [details] build.log (ppc64, 4.8.2) [...] >>> Test phase: dev-libs/tlsh-4.8.2 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-libs/tlsh-4.8.2/work/tlsh-4.8.2" * Build directory (BUILD_DIR): "/var/tmp/portage/dev-libs/tlsh-4.8.2/work/tlsh-4.8.2" ctest -j 16 --test-load 18 Test project /var/tmp/portage/dev-libs/tlsh-4.8.2/work/tlsh-4.8.2 Start 1: tlsh_unittest_len_xlen 1/1 Test #1: tlsh_unittest_len_xlen ...........***Failed 0.04 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 0.04 sec The following tests FAILED: 1 - tlsh_unittest_len_xlen (Failed) Errors while running CTest Output from these tests are in: /var/tmp/portage/dev-libs/tlsh-4.8.2/work/tlsh-4.8.2/Testing/Temporary/LastTest.log Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely. * ERROR: dev-libs/tlsh-4.8.2::gentoo failed (test phase):
Created attachment 795245 [details] LastTest.log
Created attachment 795248 [details] emerge --info
Thanks for reporting. Haven't looked at the test suite that closely yet, and I can't reproduce on amd64, but I'll look into it.
This repro's for me on sparc as well.
On hppa also.
This passes on little-endian ppc64, so this is quite certainly a big-endian problem.
I've opened https://github.com/trendmicro/tlsh/issues/131 upstream, but this looks like it will be a very high-effort fix since this code does a LOT of bit-shuffling, as all hashing algorithms do. Plus upstream does not seem to put any attention towards it, as it seems to be a dumped-over-the-wall OSS from Trend Micro. Either way however this test IS working correctly - the hashing algorithm here is definitely not functioning as intended on these architectures, and the fundamental functionality of the library is broken on them and cannot be relied upon to work as advertised.
@matoro Thanks for following up on this. As you say, tlsh appears to be dumped-over-the-wall OSS. I'm not sure what the best approach is here - to work towards getting the issue fixed, or work towards removing tlsh. It should only be diffoscope that depends on it (for fuzzy matching).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=019c5f6888d802a8c3261ff8ef6ef476d7ed0f8a commit 019c5f6888d802a8c3261ff8ef6ef476d7ed0f8a Author: Matoro Mahri <matoro@users.noreply.github.com> AuthorDate: 2023-03-20 18:50:39 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-03-22 05:28:53 +0000 profiles/arch: mask dev-libs/tlsh on big-endian Closes: https://bugs.gentoo.org/861710 Closes: https://bugs.gentoo.org/888511 Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com> Signed-off-by: Sam James <sam@gentoo.org> profiles/arch/arm64/big-endian/package.mask | 7 +++++++ profiles/arch/hppa/package.mask | 5 +++++ profiles/arch/m68k/package.mask | 7 +++++++ profiles/arch/mips/mipsel/package.mask | 7 +++++++ profiles/arch/mips/package.mask | 7 ++++++- profiles/arch/powerpc/package.mask | 9 ++++++++- profiles/arch/powerpc/ppc64/64le/package.mask | 7 +++++++ profiles/arch/s390/package.mask | 7 +++++++ profiles/arch/sparc/package.mask | 5 +++++ 9 files changed, 59 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6aabd8c98e506c3667f1b5c20a3ff87ddf32c1fc commit 6aabd8c98e506c3667f1b5c20a3ff87ddf32c1fc Author: Matoro Mahri <matoro@users.noreply.github.com> AuthorDate: 2023-04-14 23:55:20 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-15 02:17:18 +0000 profiles/features/big-endian: unmask dev-libs/tlsh Bug: https://bugs.gentoo.org/861710 Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com> Signed-off-by: Sam James <sam@gentoo.org> profiles/features/big-endian/package.mask | 7 ------- 1 file changed, 7 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12faf25bcfc6a5d8419ed0b0024c31cd2f55b5cc commit 12faf25bcfc6a5d8419ed0b0024c31cd2f55b5cc Author: Matoro Mahri <matoro@users.noreply.github.com> AuthorDate: 2023-04-14 23:54:21 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-15 02:17:09 +0000 dev-libs/tlsh: add big-endian fix See: https://github.com/trendmicro/tlsh/issues/131 Bug: https://bugs.gentoo.org/861710 Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com> Signed-off-by: Sam James <sam@gentoo.org> dev-libs/tlsh/tlsh-4.8.2.ebuild | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)