Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 2021 08:47:44 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "lev@freebsd.org" <lev@FreeBSD.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>, FreeBSD Hackers <freebsd-hackers@FreeBSD.org>
Subject:   Re: `clang -pg` generates binary which coredumps on start
Message-ID:  <4A2DB8CA-F152-47F4-A546-50162D206DC0@FreeBSD.org>
In-Reply-To: <61cebbd1-4e8d-d9d7-dda2-388e81e61599@FreeBSD.org>
References:  <61cebbd1-4e8d-d9d7-dda2-388e81e61599@FreeBSD.org>

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

--Apple-Mail=_E0B32DCF-D040-4AF1-B968-0C2F20B75892
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 29 Jan 2021, at 00:57, Lev Serebryakov <lev@FreeBSD.org> wrote:
>=20
> I'm trying to profile my user-level program on FreeBSD 12-STABLE =
(amd64). When I build it with `cc -g -pg -O3` it coredumps on start. =
What do I do wrong?
>=20
> (lldb) bt
> * thread #1, name =3D 'mergenets', stop reason =3D signal SIGSEGV
>  * frame #0: 0x0000000000000000
>    frame #1: 0x000000000028ebbf =
mergenets`__vdso_gettc(th=3D0x00007ffffffff270, tc=3D0x00007fffffffddbc) =
at __vdso_gettc.c:0
>    frame #2: 0x000000000028e8c3 mergenets`binuptime [inlined] =
tc_delta(th=3D<unavailable>) at __vdso_gettimeofday.c:46:10
>    frame #3: 0x000000000028e8ba =
mergenets`binuptime(bt=3D0x00007fffffffde08, tk=3D0x00007ffffffff1b0, =
abs=3D0) at __vdso_gettimeofday.c:78
>    frame #4: 0x000000000028ea73 =
mergenets`__vdso_clock_gettime(clock_id=3D4, ts=3D0x00007fffffffde68) at =
__vdso_gettimeofday.c:165:10
>    frame #5: 0x0000000000281efb mergenets`__clock_gettime(clock_id=3D4, =
ts=3D0x00007fffffffde68) at clock_gettime.c:48:11
>    frame #6: 0x000000000024339f mergenets`nstime_update_impl [inlined] =
nstime_get(time=3D0x0000000800403a88) at jemalloc_nstime.c:128:2
>    frame #7: 0x0000000000243395 =
mergenets`nstime_update_impl(time=3D0x0000000800403a88) at =
jemalloc_nstime.c:160
>    frame #8: 0x0000000000234b6d mergenets`__je_arena_new [inlined] =
arena_decay_reinit(decay=3D0x0000000800403a20, decay_ms=3D<unavailable>) =
at jemalloc_arena.c:572:2
>    frame #9: 0x0000000000234b21 mergenets`__je_arena_new [inlined] =
arena_decay_init(decay=3D0x0000000800403a20, decay_ms=3D<unavailable>, =
stats=3D0x00000008004009a0) at jemalloc_arena.c:593
>    frame #10: 0x0000000000234b1a =
mergenets`__je_arena_new(tsdn=3D0x0000000000000000, ind=3D0, =
extent_hooks=3D<unavailable>) at jemalloc_arena.c:1858
>    frame #11: 0x00000000002239c0 mergenets`__je_arena_init [inlined] =
arena_init_locked(tsdn=3D0x0000000000000000, ind=3D0, =
extent_hooks=3D0x0000000000205778) at jemalloc_jemalloc.c:338:10
>    frame #12: 0x00000000002239b2 =
mergenets`__je_arena_init(tsdn=3D0x0000000000000000, ind=3D0, =
extent_hooks=3D0x0000000000205778) at jemalloc_jemalloc.c:366
>    frame #13: 0x000000000022f946 mergenets`malloc_init_hard_a0_locked =
at jemalloc_jemalloc.c:1328:6
>    frame #14: 0x0000000000222cf5 mergenets`a0ialloc [inlined] =
malloc_init_hard_a0 at jemalloc_jemalloc.c:1343:8
>    frame #15: 0x0000000000222caa mergenets`a0ialloc [inlined] =
malloc_init_a0 at jemalloc_jemalloc.c:214
>    frame #16: 0x0000000000222caa mergenets`a0ialloc(size=3D6223, =
zero=3Dfalse, is_internal=3Dfalse) at jemalloc_jemalloc.c:234
>    frame #17: 0x00000000002225fc mergenets`__libc_allocate_tls =
[inlined] malloc_aligned(size=3D6200, align=3D16) at tls.c:135:8
>    frame #18: 0x00000000002225e2 =
mergenets`__libc_allocate_tls(oldtls=3D0x0000000000000000, =
tcbsize=3D<unavailable>, tcbalign=3D<unavailable>) at tls.c:359
>    frame #19: 0x00000000002227d0 mergenets`_init_tls at tls.c:469:8
>    frame #20: 0x000000000021f234 mergenets`_start(ap=3D<unavailable>, =
cleanup=3D<unavailable>) at crt1.c:66:3

Likely https://bugs.freebsd.org/249121 (and maybe =
https://bugs.llvm.org/show_bug.cgi?id=3D48165).

-Dimitry


--Apple-Mail=_E0B32DCF-D040-4AF1-B968-0C2F20B75892
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

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYBO9oAAKCRCwXqMKLiCW
o6TKAJ9SqcJppfE1Qrz0gLc1DtZWB8bDVgCcDcRyV8JDDjYsgak751Vd8u4kBR4=
=uWXR
-----END PGP SIGNATURE-----

--Apple-Mail=_E0B32DCF-D040-4AF1-B968-0C2F20B75892--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A2DB8CA-F152-47F4-A546-50162D206DC0>