Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2024 09:09:20 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        hartmut.brandt@dlr.de, Mark Johnston <markj@FreeBSD.org>, FreeBSD Current <freebsd-current@freebsd.org>, Brooks Davis <brooks@FreeBSD.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Re: sanitizers broken (was RE: libc/libsys split coming soon)
Message-ID:  <5BD9DDEA-925D-437A-9803-C473CC4B0C6E@yahoo.com>
In-Reply-To: <41665018-A638-43BB-85D2-EAB1878028FA@yahoo.com>
References:  <F68DB36B-51A9-4433-9008-7FB44D77D06C@yahoo.com> <41665018-A638-43BB-85D2-EAB1878028FA@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[Brooks' activity related to commit =
99ea67573164637d633e8051eb0a5d52f1f9488e
looks likely for what changed the status: "lib{c,sys}: move auxargs more
firmly into libsys".]

On Feb 21, 2024, at 09:02, Mark Millard <marklmi@yahoo.com> wrote:

> On Feb 21, 2024, at 08:38, Mark Millard <marklmi@yahoo.com> wrote:
>=20
>> Mark Johnston <markj_at_freebsd.org> wrote on
>> Date: Wed, 21 Feb 2024 13:33:43 UTC :
>>=20
>>> On Wed, Feb 21, 2024 at 09:52:23AM +0000, Hartmut.Brandt@dlr.de =
wrote:
>>>> Hi,
>>>>=20
>>>> I updated yesterday and now event a minimal program with
>>>>=20
>>>> cc -fsanitize=3Daddress
>>>>=20
>>>> produces
>>>>=20
>>>> ld: error: undefined symbol: __elf_aux_vector
>>>>>>> referenced by sanitizer_linux_libcdep.cpp:950 =
(/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_=
linux_libcdep.cpp:950)
>>>>>>> sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive =
/usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a
>>>> cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
>>>>=20
>>>> I think this is caused by the libsys split.
>>>=20
>>> I don't see any such problem on a system running 5f7ac491eef4, which
>>> includes the libsys split. Which compiler are you using, and which
>>> revision are you running?
>>=20
>> Trivial to reproduce via pkgbase install/upgrade:
>>=20
>> # uname -apKU
>> FreeBSD aarch64-main-pkgs 15.0-CURRENT FreeBSD 15.0-CURRENT =
main-n268410-445d3d227e68 GENERIC-NODEBUG arm64 aarch64 1500014 1500014
>=20
> Gack: pkgbase does not have the kernel and world at the same place
> relative to git commits of source code. See my note from yesterday:
>=20
> =
https://lists.freebsd.org/archives/freebsd-pkgbase/2024-February/000319.ht=
ml
>=20
> Looking at /usr/src/tests/sys/kern/sigsys.c in this pkgbse context
> shows the content from about 10 hours after 445d3d227e68's commit:
>=20
> git: e53b83a849e3 - main - tests/sigsys: initialize parameter passed =
to sysctlbyname() Gleb Smirnoff
> (CommitDate: 2024-02-20 22:37:45 +0000)
>=20
> (Note: The next commit's source was not present.)
>=20
>=20
>> # more main.c
>> int main(void) { return 0; }
>>=20
>> # cc -fsanitize=3Daddress main.c
>> ld: error: undefined symbol: __elf_aux_vector
>>>>> referenced by sanitizer_linux_libcdep.cpp:950 =
(/home/bapt/worktrees/main/contrib/llvm-project/compiler-rt/lib/sanitizer_=
common/sanitizer_linux_libcdep.cpp:950)
>>>>>             sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in =
archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-aarch64.a
>>>>> referenced by sanitizer_linux_libcdep.cpp:950 =
(/home/bapt/worktrees/main/contrib/llvm-project/compiler-rt/lib/sanitizer_=
common/sanitizer_linux_libcdep.cpp:950)
>>>>>             sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in =
archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-aarch64.a
>> cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
>=20
> I do not see the issue in my (somehwat older) personal builds:
>=20
> # uname -apKU
> you have mail
> FreeBSD CA72-16Gp-ZFS 15.0-CURRENT FreeBSD 15.0-CURRENT #134 =
main-n268363-8b67c670a49b-dirty: Sat Feb 17 16:22:31 PST 2024     =
root@CA72-16Gp-ZFS:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm6=
4.aarch64/sys/GENERIC-NODBG-CA72 arm64 aarch64 1500014 1500014
>=20
> (Here kernel and world match git hashes: 8b67c670a49b . But
> my personal builds have patches and other tailoring relative
> to the official git hash they are based on.)
>=20

My guess is:

Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 19 Feb 2024 22:44:35 UTC=20
The branch main has been updated by brooks:

URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D99ea67573164637d633e8051eb0a5d52=
f1f9488e

commit 99ea67573164637d633e8051eb0a5d52f1f9488e
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-02-19 22:44:08 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-02-19 22:44:08 +0000

lib{c,sys}: move auxargs more firmly into libsys

Continue to filter the public interface (elf_aux_info()), but entierly
relocate the private interfaces (_elf_aux_info(),
__init_elf_aux_vector(), and __elf_aux_vector) to libsys.

This ensures that rtld updates the correct (only) copy of
__elf_aux_vector. After 968a18975adc9c2a619bb52aa2f009de99fc9e24
updates were confused and __getosreldate was failing, causing
the system to fall back to compat compat12 syscalls in some cases.

Return to explicitly linking libc to libsys and link libthr with libc
and libsys (in that order).

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43910
. . .

=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?5BD9DDEA-925D-437A-9803-C473CC4B0C6E>