selftest: Fix address sanitizer with python3
authorAndreas Schneider <asn@samba.org>
Tue, 6 Sep 2022 06:59:56 +0000 (08:59 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Sep 2022 22:34:36 +0000 (22:34 +0000)
commit1591d7bdbf045bee45e7e2775a7be464fe236d1c
tree7aadaad88359914937f8214683a1618aa2c4da49
parent08dda9cefdddf6953ac54b282e8b0e434426d1d6
selftest: Fix address sanitizer with python3

==9542==AddressSanitizer: failed to intercept 'crypt'
==9542==AddressSanitizer: failed to intercept 'crypt_r'

[..]

AddressSanitizer:DEADLYSIGNAL
=================================================================
==29768==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7ffcec4bf3c0 sp 0x7ffcec4beb58 T0)
==29768==Hint: pc points to the zero page.
==29768==The signal is caused by a READ memory access.
==29768==Hint: address points to the zero page.
    #0 0x0  (<unknown module>)
    #1 0x7f052cca4129 in crypt_crypt_impl /usr/src/debug/python310-core-3.10.6-3.1.x86_64/Modules/_cryptmodule.c:44

We would need to build python without --as-needed as we can't so that
we need to preload the library to avoid a segfault.

See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98669

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/selftest.pl
selftest/wscript