Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Sep 2023 19:00:01 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-arm <freebsd-arm@freebsd.org>, Current FreeBSD <freebsd-current@freebsd.org>
Subject:   Re: [Bug 273506] main [so: 15] aarch64 kyua python use fails with: . . . and dlerror is reporting "/usr/lib/ossl-modules/legacy.so: Undefined symbol \"MD4_Update\"", '\000' <repeats 449 times> [crude patch]
Message-ID:  <DE2FF8ED-EEDA-40A7-B453-EA8A3866C1EC@yahoo.com>
In-Reply-To: <ACD328D4-46FA-48A5-B653-987E6CBA45C2@yahoo.com>
References:  <721EBF15-6905-437E-9B23-A4E3D1129658@yahoo.com> <ACD328D4-46FA-48A5-B653-987E6CBA45C2@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 2, 2023, at 09:37, Mark Millard <marklmi@yahoo.com> wrote:

> On Sep 2, 2023, at 00:35, Mark Millard <marklmi@yahoo.com> wrote:
>=20
>> For:
>>=20
>>> Date: Sat, 02 Sep 2023 00:58:29 UTC=20
>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273506
>>>=20
>>> Bug ID: 273506
>>> Summary: main [so: 15] aarch64 kyua python use fails with:
>>> "RuntimeError: OpenSSL 3.0's legacy provider failed to
>>> load"
>>> Product: Base System
>>> Version: CURRENT
>>> Hardware: Any
>>> OS: Any
>>> Status: New
>>> Severity: Affects Only Me
>>> Priority: ---
>>> Component: arm
>>> Assignee: freebsd-arm@FreeBSD.org
>>> Reporter: marklmi26-fbsd@yahoo.com
>>=20
>> Turns out that internally dlerror is reporting:
>>=20
>> "/usr/lib/ossl-modules/legacy.so: Undefined symbol \"MD4_Update\"", =
'\000' <repeats 449 times>
>>=20
>> (as shown via a gdb session printing the string).
>>=20
>> See:
>>=20
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273506#c3
>>=20
>> where I finally got to that information.
>=20
> amd64 did not have:
>=20
> devel/py-pytest-twisted
> devel/py-twisted
> net/py-dpkt
> security/nist-kat
> security/openvpn
>=20
> installed and so was not doing the same sequence of dlopen
> calls.
>=20
> After adding those, the amd64 run fails like aarch64: It then starts =
to try
> to use .../cryptography/hazmat/bindings/_rust.abi3.so leads to the =
problem.
>=20
> [Detaching after fork from child process 98729]
>=20
> Breakpoint 1.1, dlopen (name=3Dname@entry=3D0x803239710 "libc.so.7", =
mode=3D2) at /usr/main-src/libexec/rtld-elf/rtld.c:3662
> 3662 return (rtld_dlopen(name, -1, mode));
> (gdb) c
> Continuing.
>=20
> Breakpoint 1.1, dlopen (name=3Dname@entry=3D0x8032c80d0 =
"/usr/local/lib/python3.9/site-packages/cryptography/hazmat/bindings/_rust=
.abi3.so", mode=3D2) at /usr/main-src/libexec/rtld-elf/rtld.c:3662
> 3662 return (rtld_dlopen(name, -1, mode));
> (gdb) c
> Continuing.
>=20
> Breakpoint 1.1, dlopen (name=3Dname@entry=3D0x8032c7440 =
"/usr/local/lib/python3.9/site-packages/_cffi_backend.cpython-39.so", =
mode=3D2) at /usr/main-src/libexec/rtld-elf/rtld.c:3662
> 3662 return (rtld_dlopen(name, -1, mode));
> (gdb) c
> Continuing.
>=20
> Breakpoint 1.1, dlopen (name=3Dname@entry=3D0x80219d080 =
"/usr/lib/ossl-modules/legacy.so", mode=3D2) at =
/usr/main-src/libexec/rtld-elf/rtld.c:3662
> 3662 return (rtld_dlopen(name, -1, mode));
> (gdb) c
> Continuing.
> INTERNALERROR> Traceback (most recent call last):
> . . .
>=20
> This appears to be tied to devel/py-twisted and/or =
devel/py-pytest-twisted
> but like anything leading to loading
> .../cryptography/hazmat/bindings/_rust.abi3.so is going to get the
> problem.
>=20

The following crude patch leads to kyua's python use working
for examples/test_examples.py with devel/py-pytest-twisted and
devel/py-twisted and the like installed. The below might not
end up with leading whitespace preserved:

# git -C /usr/main-src/ diff crypto/openssl/crypto/init.c
diff --git a/crypto/openssl/crypto/init.c b/crypto/openssl/crypto/init.c
index cacf637c89f8..77f693fcfa05 100644
--- a/crypto/openssl/crypto/init.c
+++ b/crypto/openssl/crypto/init.c
@@ -159,7 +159,7 @@ =
DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
         if (!err_shelve_state(&err))
             return 0;
=20
-        dso =3D DSO_dsobyaddr(&base_inited, =
DSO_FLAG_NO_UNLOAD_ON_FREE);
+        dso =3D DSO_dsobyaddr(&base_inited, =
DSO_FLAG_NO_UNLOAD_ON_FREE|DSO_FLAG_GLOBAL_SYMBOLS);
         /*
          * In case of No!, it is uncertain our exit()-handlers can =
still be
          * called. After dlclose() the whole library might have been =
unloaded

(A variant of the above note is also in my separate bugzilla.)

For reference:

# /usr/bin/kyua test -k /usr/tests/Kyuafile examples/test_examples.py
examples/test_examples.py:TestExampleSimple::test_get_properties -> =
skipped: comment me to run the test [0.582s]
examples/test_examples.py:TestExampleSimple::test_one -> skipped: =
comment me to run the test [0.589s]
examples/test_examples.py:TestExampleSimple::test_parametrize[AF_INET6] =
-> skipped: comment me to run the test [0.582s]
examples/test_examples.py:TestExampleSimple::test_parametrize[AF_INET] =
-> skipped: comment me to run the test [0.595s]
examples/test_examples.py:TestExampleSimple::test_parametrize[FAMILY_39] =
-> skipped: comment me to run the test [0.589s]
examples/test_examples.py:TestExampleSimple::test_syscall_failure -> =
skipped: comment me to run the test [0.590s]
examples/test_examples.py:TestExampleSimple::test_two -> skipped: =
Required file '/path/file1' not found [0.001s]
examples/test_examples.py:TestExampleSimple::test_with_cleanup -> passed =
[0.583s]
examples/test_examples.py:TestExampleSimplest::test_one -> skipped: =
comment me to run the test [0.583s]
examples/test_examples.py:TestVnetDual1::test_ifstat -> skipped: comment =
me to run the test [0.593s]
examples/test_examples.py:TestVnetSimple::test_ping -> skipped: comment =
me to run the test [0.589s]
examples/test_examples.py:TestVnetSimple::test_topology -> skipped: =
comment me to run the test [0.588s]

Results file id is usr_tests.20230903-014520-255324
Results saved to =
/usr/home/root/.kyua/store/results.usr_tests.20230903-014520-255324.db

12/12 passed (0 failed)


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DE2FF8ED-EEDA-40A7-B453-EA8A3866C1EC>