Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 861710 - dev-libs/tlsh-4.8.2 - fails tests on ppc64 (and on musl amd64) - tlsh_unittest_len_xlen
Summary: dev-libs/tlsh-4.8.2 - fails tests on ppc64 (and on musl amd64) - tlsh_unittes...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Thomas Bracht Laumann Jespersen
URL: https://github.com/trendmicro/tlsh/is...
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks: 888511
  Show dependency tree
 
Reported: 2022-07-28 12:06 UTC by ernsteiswuerfel
Modified: 2023-04-15 02:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (ppc64, 4.8.2) (tlsh-4.8.2:20220728-115737.log,15.64 KB, text/plain)
2022-07-28 12:06 UTC, ernsteiswuerfel
Details
LastTest.log (LastTest.log,1.01 KB, text/plain)
2022-07-28 12:07 UTC, ernsteiswuerfel
Details
emerge --info (file_861710.txt,6.52 KB, text/plain)
2022-07-28 12:07 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2022-07-28 12:06:53 UTC
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):
Comment 1 ernsteiswuerfel archtester 2022-07-28 12:07:09 UTC
Created attachment 795245 [details]
LastTest.log
Comment 2 ernsteiswuerfel archtester 2022-07-28 12:07:34 UTC
Created attachment 795248 [details]
emerge --info
Comment 3 Thomas Bracht Laumann Jespersen 2022-07-28 12:41:01 UTC
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.
Comment 4 matoro archtester 2023-02-24 15:02:02 UTC
This repro's for me on sparc as well.
Comment 5 matoro archtester 2023-03-16 17:18:14 UTC
On hppa also.
Comment 6 matoro archtester 2023-03-16 18:13:56 UTC
This passes on little-endian ppc64, so this is quite certainly a big-endian problem.
Comment 7 matoro archtester 2023-03-16 19:35:25 UTC
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.
Comment 8 Thomas Bracht Laumann Jespersen 2023-03-18 13:35:44 UTC
@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).
Comment 9 Larry the Git Cow gentoo-dev 2023-03-22 05:30:11 UTC
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(-)
Comment 10 Larry the Git Cow gentoo-dev 2023-04-15 02:17:52 UTC
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(-)