From nobody Sat Jun 04 03:24:53 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6F5F41BD3959 for ; Sat, 4 Jun 2022 03:24:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LFQ9L435Hz4bHV for ; Sat, 4 Jun 2022 03:24:54 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFFBE16216 for ; Sat, 4 Jun 2022 03:24:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2543OrE9012987 for ; Sat, 4 Jun 2022 03:24:53 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2543OrwR012986 for bugs@FreeBSD.org; Sat, 4 Jun 2022 03:24:53 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264444] dtrace ustack() cannot decode stack frames in shared libraries opened with dlopen after the program terminates Date: Sat, 04 Jun 2022 03:24:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: asomers@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654313094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsUUBNeD/yYFPaK59fIWZAFIUUenw78RaFsYOYTu80E=; b=jf4JQ095ktzIIA2vK1GbtZgC9K1M7PBS98xmg4I0LEi3X5SlWvpS7Wz8SyofJCCOK9W9hw AfCHXZHbMm7m70DSCblvcx7KBG6ZV3TcjBUyV459PrO2kZZjRoL7687Hz6hp4I11Xy5I0z p6vup/rrE53f6eVlsnr/j7wUYpve2rZdAlGMXaO/r3DlCr8BPGc/bXFvapSyQrnWTv96+a aJbIE0moHyzdU6PgXBDkf+o+uiYVrJRcxqPBp+tLe6FJi/B5myztyAa+sdrOJTvAthbqN9 usAxWCr60up8HCesQcFa5kKtedcbTyZr/5I7vPj5sNrdaZ35O9TBB5srOL+iKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654313094; a=rsa-sha256; cv=none; b=igZZ1HI3iMOZOwOfBrsK3mw7oKMwzBSUGWVGbOfmkgDnQYD/I7XSUdPni5fz8XLtbesBNN 6ucjMUkuIktkr9g6sy6e3j4oBxtO/1ps6b460/9F/tmmeMLWHscL/E/EFDnnf++7EZFzvG zvf3QvDA0vPz4wHbPQyg3IZmcxzQH2FqXyQUUzLUzZxIaltVdlZe2c6GGhxnXpG93glXoM wm+icrj+2a2Sq61L7njt/tNem9t1x1Ktp7eSror7so8tlGp4+r8DGi9tU8XCnxvnRCVoHl 5AmZYhmzatbssQt8VAeKhVh6kqJus6AeFXAjXZX26rnrYuUKMTIVH4OmRbrxwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264444 Bug ID: 264444 Summary: dtrace ustack() cannot decode stack frames in shared libraries opened with dlopen after the program terminates Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: asomers@FreeBSD.org dtrace's ustack() function is supposed to unwind a user stack trace. It usually can. But it seems that it cannot decode stack frames from a shared library, if that shared library was loaded with dlopen and the program exits before dtrace does. Steps to Reproduce (admittedly, with difficulty) 1) pkg install rust c-blosc isa-l llvm pkgconf git 2) pkg install fio-3.30 # May not build with other fio versions 3) git clone https://github.com/bfffs/bfffs.git 4) cd bfffs 5) git checkout 6e2c7b16b681d54d239b0f7518e612d5df36d096 6) cargo build -p bfffs-fio 7) truncate -s 1g /tmp/bfffs.img 8) cargo run --bin bfffs -- pool create testpool /tmp/bfffs.img 9) sudo dtrace -x ustackframes=3D100 -n 'profile-199 /pid =3D=3D $target &&= arg1/ {@[ustack()] =3D count();}' -o fio.stacks -c "fio bfffs-fio/data/ci.fio" 10) Examine fio.stacks. It will contain frames from fio and libc.so, but n= one from libbfffs.so. Where there should be some, it will instead contain hex numbers, like this: libc.so.7`memcpy+0xb0 0xfcdfdc73c fio`io_u_queued_complete+0x7a fio`wait_for_completions+0x7b fio`do_io+0x678 fio`thread_main+0xbe0 libthr.so.3`0x822130a7a --=20 You are receiving this mail because: You are the assignee for the bug.=