Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2023 01:50:07 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        sgk@troutmask.apl.washington.edu
Cc:        freebsd-current@freebsd.org
Subject:   Re: core dump in ld during buildworld
Message-ID:  <25B4B3AD-3791-44D0-9FFA-7F1C2A9E82B9@FreeBSD.org>
In-Reply-To: <Y/FuYLIbwo0xBPVK@troutmask.apl.washington.edu>
References:  <Y/FuYLIbwo0xBPVK@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_A7E4265B-CB90-49F7-ABED-E40FD401FE93
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 19 Feb 2023, at 01:33, Steve Kargl <sgk@troutmask.apl.washington.edu> =
wrote:
>=20
> During biuldworld,
>=20
> =3D=3D> usr.bin/nm (obj,all,install)
> cc -O2 -pipe -g -fno-common -I/usr/src/contrib/elftoolchain/libelftc =
-I/usr/src/contrib/elftoolchain/common -std=3Dgnu99 =
-Wno-format-zero-length -Wsystem-headers -Wall -Wno-format-y2k -W =
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes =
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch =
-Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts =
-Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time =
-Wmissing-variable-declarations -Wthread-safety -Wno-empty-body =
-Wno-string-plus-int -Wno-unused-const-variable =
-Wno-error=3Dunused-but-set-variable -Qunused-arguments =
-I/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/include  -Wl,-zrelro =
-static   -L/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/lib -o nm nm.o  =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libdwarf -ldwarf =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelf -lelf =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libz -lz =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelftc -lelftc_pie =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelf -lelf  -legacy
> PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and =
include the crash backtrace.
> Stack dump:
> 0.      Program arguments: /usr/bin/ld --eh-frame-hdr -Bstatic -o nm =
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbeginT.o =
-L/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/lib =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libdwarf =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelf =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libz =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelftc =
-L/usr/obj/usr/src/amd64.amd64/tmp/obj-tools/lib/libelf -L/usr/lib =
-zrelro nm.o -ldwarf -lelf -lz -lelftc_pie -lelf -legacy -lgcc -lgcc_eh =
-lc -lgcc -lgcc_eh /usr/lib/crtend.o /usr/lib/crtn.o
> #0 0x000000000164f1c1 (/usr/bin/ld+0x164f1c1)
> #1 0x000000000164d4a5 (/usr/bin/ld+0x164d4a5)
> #2 0x000000000164f8e0 (/usr/bin/ld+0x164f8e0)
> #3 0x0000000825243a60 (/lib/libthr.so.3+0x19a60)
> #4 0x000000082524301f (/lib/libthr.so.3+0x1901f)
> #5 0x00000008231e48a3 ([vdso]+0x2d3)
> #6 0x0000000000cf4830 (/usr/bin/ld+0xcf4830)
> #7 0x0000000000cf7b89 (/usr/bin/ld+0xcf7b89)
> #8 0x0000000000cf55a3 (/usr/bin/ld+0xcf55a3)
> #9 0x0000000000cf5217 (/usr/bin/ld+0xcf5217)
> #10 0x0000000000dabe23 (/usr/bin/ld+0xdabe23)
> #11 0x0000000000da7754 (/usr/bin/ld+0xda7754)
> #12 0x0000000000cf4ec5 (/usr/bin/ld+0xcf4ec5)
> #13 0x0000000000cc6e83 (/usr/bin/ld+0xcc6e83)
> #14 0x0000000000cbe4bc (/usr/bin/ld+0xcbe4bc)
> #15 0x0000000000cbccda (/usr/bin/ld+0xcbccda)
> cc: error: unable to execute command: Segmentation fault (core dumped)
> cc: error: linker command failed due to signal (use -v to see =
invocation)
> *** Error code 254
>=20
> Stop.
> make[3]: stopped in /usr/src/usr.bin/nm
> *** Error code 1
>=20
> % find /usr/obj/ -name \*.core
> /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/usr.bin/nm/ld.lld.core
> %  uname -a
> FreeBSD hotrats 14.0-CURRENT FreeBSD 14.0-CURRENT #0 =
main-n260094-906c312bbf74: Fri Feb  3 21:28:39 PST 2023     =
kargl@hotrats:/usr/obj/usr/src/amd64.amd64/sys/HOTRATS amd64
>=20
> Is the wrong ld being called?  The failing command shows /usr/bin/ld.
> Should this be  /usr/obj/usr/src/amd64.amd64/tmp/usr/bin/ld?

It looks like this happens during the early stages, most likely
cross-tools? (As it appears to be building usr.bin/nm under obj-tools.)

At that point it is still using the system compiler and linker, and it
seems that the latter is lld. Do you know which version it is?

-Dimitry


--Apple-Mail=_A7E4265B-CB90-49F7-ABED-E40FD401FE93
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCY/FyPwAKCRCwXqMKLiCW
o5ulAJ4hQFq7InjIU414xXh2ALqJz78dnQCfcs2YrclNeZE4HZqO0X1rMTv9obk=
=xhTA
-----END PGP SIGNATURE-----

--Apple-Mail=_A7E4265B-CB90-49F7-ABED-E40FD401FE93--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25B4B3AD-3791-44D0-9FFA-7F1C2A9E82B9>