netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

[2.4] Integration tests fail with bundled SSL on Debian

Open rdmark opened this issue 1 year ago • 5 comments

On Debian 12, with libssl-dev but not libwolfssl-dev installed, running the distribution tests results in failure. It seems like the test binary isn't being linked correctly with the openssl library.

[0/1] Running all tests.
1/2 test1        OK              0.03s
2/2 test2        FAIL            0.10s   killed by signal 11 SIGSEGV
>>> LD_LIBRARY_PATH=/home/dmark/netatalk2/build/meson-private/dist-build/libatalk MALLOC_PERTURB_=46 /home/dmark/netatalk2/build/meson-private/dist-build/test/afpd/afpdtest
――――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――
Jul 06 09:36:12.595262 [30928] {status.c:670} (E:AFPDaemon): ERROR: Cannot write in /usr/local/etc/netatalk/afp_signature.conf (Permission denied). Using one-time signature.
Jul 06 09:36:12.597998 [30928] {afp_config.c:361} (N:AFPDaemon): AFP/TCP started, advertising 192.168.64.2:10548 (2.4.2)
Jul 06 09:36:12.603929 [30928] {uam.c:51} (E:AFPDaemon): uam_load(uams_dhx.so): failed to load: /usr/local/lib/x86_64-linux-gnu/netatalk/uams_dhx.so: undefined symbol: CAST_cbc_encrypt
Jul 06 09:36:12.604028 [30928] {auth.c:1113} (E:AFPDaemon): uam: uams_dhx.so load failure
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


Summary of Failures:

2/2 test2 FAIL            0.10s   killed by signal 11 SIGSEGV

Ok:                 1   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/dmark/netatalk2/build/meson-private/dist-build/meson-logs/testlog.txt
FAILED: meson-internal__test 
/usr/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
Running unit tests on the distribution package failed
Dist check build directory was /home/dmark/netatalk2/build/meson-private/dist-build

rdmark avatar Jul 06 '24 00:07 rdmark

Hmm, the issue went away after I messed with apt to uninstall/reinstall/upgrade packages.

FWIW this is a different Debian system from the one where https://github.com/Netatalk/netatalk/issues/1170 is happening (which it still is) but the same Bookworm release.

The linking of of test binaries is so very flaky...

rdmark avatar Jul 06 '24 01:07 rdmark

Strange, this was resolved with https://github.com/Netatalk/netatalk/pull/1198

$ meson test
ninja: no work to do.
ninja: Entering directory `/home/dmark/dev/netatalk2/build'
ninja: no work to do.
1/2 test1        OK              0.01s
2/2 test2        OK              0.41s

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

Full log written to /home/dmark/dev/netatalk2/build/meson-logs/testlog.txt

rdmark avatar Jul 06 '24 06:07 rdmark

This has resurfaced...

rdmark avatar Jul 12 '24 07:07 rdmark

With https://github.com/Netatalk/netatalk/pull/1244 it works in my Debian 12 VM now. But on my Debian 12 physical system, it fails both when wolfssl is installed and when it's missing. So the behavior shifted again...

rdmark avatar Jul 14 '24 13:07 rdmark

Valgrind offers this stacktrace

$ meson test --wrap=valgrind test2
==1116356== Memcheck, a memory error detector
==1116356== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==1116356== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==1116356== Command: /home/dmark/dev/netatalk2/build/test/afpd/afpdtest
==1116356== 
==1116356== Invalid read of size 1
==1116356==    at 0x4846782: strlen (vg_replace_strmem.c:494)
==1116356==    by 0x4A438DD: strdup (strdup.c:41)
==1116356==    by 0x140043: uam_register (uam.c:135)
==1116356==    by 0x493497F: uam_setup (uams_dhx2_pam.c:927)
==1116356==    by 0x13FDEF: uam_load (uam.c:80)
==1116356==    by 0x120B5E: auth_load (auth.c:1109)
==1116356==    by 0x117C6B: AFPConfigInit (afp_config.c:507)
==1116356==    by 0x117EB3: configinit (afp_config.c:566)
==1116356==    by 0x114373: main (test.c:68)
==1116356==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1116356== 
==1116356== 
==1116356== Process terminating with default action of signal 11 (SIGSEGV)
==1116356==  Access not within mapped region at address 0x0
==1116356==    at 0x4846782: strlen (vg_replace_strmem.c:494)
==1116356==    by 0x4A438DD: strdup (strdup.c:41)
==1116356==    by 0x140043: uam_register (uam.c:135)
==1116356==    by 0x493497F: uam_setup (uams_dhx2_pam.c:927)
==1116356==    by 0x13FDEF: uam_load (uam.c:80)
==1116356==    by 0x120B5E: auth_load (auth.c:1109)
==1116356==    by 0x117C6B: AFPConfigInit (afp_config.c:507)
==1116356==    by 0x117EB3: configinit (afp_config.c:566)
==1116356==    by 0x114373: main (test.c:68)
==1116356==  If you believe this happened as a result of a stack
==1116356==  overflow in your program's main thread (unlikely but
==1116356==  possible), you can try to increase the size of the
==1116356==  main thread stack using the --main-stacksize= flag.
==1116356==  The main thread stack size used in this run was 8388608.
==1116356== 
==1116356== HEAP SUMMARY:
==1116356==     in use at exit: 146,200 bytes in 753 blocks
==1116356==   total heap usage: 1,390 allocs, 637 frees, 185,661 bytes allocated
==1116356== 
==1116356== LEAK SUMMARY:
==1116356==    definitely lost: 0 bytes in 0 blocks
==1116356==    indirectly lost: 0 bytes in 0 blocks
==1116356==      possibly lost: 2,304 bytes in 1 blocks
==1116356==    still reachable: 143,896 bytes in 752 blocks
==1116356==         suppressed: 0 bytes in 0 blocks
==1116356== Rerun with --leak-check=full to see details of leaked memory
==1116356== 
==1116356== For lists of detected and suppressed errors, rerun with: -s
==1116356== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==============================================================================


Summary of Failures:

1/1 test2 FAIL            1.23s   killed by signal 11 SIGSEGV

rdmark avatar Jul 26 '24 10:07 rdmark

Discarding this. I won't address trivial bugs in the 2.x branches.

FWIW, when I run a fresh Bookworm chroot on the same machine this issue does not occur. So there's something piece of software or configuration somewhere that's causing a conflict.

rdmark avatar Sep 18 '24 09:09 rdmark