From owner-freebsd-bugs@freebsd.org Thu Jan 30 22:25:27 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B2532293EB for ; Thu, 30 Jan 2020 22:25:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 487w0Q6ZR3z3GTm for ; Thu, 30 Jan 2020 22:25:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id DFDD82293E9; Thu, 30 Jan 2020 22:25:26 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFA062293E8 for ; Thu, 30 Jan 2020 22:25:26 +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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487w0Q5ZNVz3GTl for ; Thu, 30 Jan 2020 22:25:26 +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) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAB864316 for ; Thu, 30 Jan 2020 22:25:26 +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 00UMPQ1a055973 for ; Thu, 30 Jan 2020 22:25:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 00UMPQMl055972 for bugs@FreeBSD.org; Thu, 30 Jan 2020 22:25:26 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 243746] backtrace() not returning any stack frames [12.1-RELEASE-p1 amd64] Date: Thu, 30 Jan 2020 22:25:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mandree@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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 22:25:27 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243746 Bug ID: 243746 Summary: backtrace() not returning any stack frames [12.1-RELEASE-p1 amd64] Product: Base System Version: 12.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: mandree@FreeBSD.org *** Description Trying to debug e2fsprogs, which uses backtrace(), I did not see stack backtraces for a crasher. I have then adapted a test program found on the net, which also does not fi= nd stack backtraces - running the same executable under gdb until it receives a provoked SIGSEGV yields a proper backtrace. *** Received output: Signal 11 in dump_trace - have 0 frames *** Expected output SIMILAR TO (this is taken from the same program under L= inux - only adapted to use int, not size_t, and omitting -lexecinfo because backtrace is part of GNU libc): Signal in dump_trace - have 8 frames ./try-bt[0x401185] /lib64/libc.so.6(+0x3c6b0)[0x7f951de3a6b0] ./try-bt(boom+0x10)[0x4011e0] ./try-bt(two+0xe)[0x4011f4] ./try-bt(one+0xe)[0x401205] ./try-bt(main+0x1d)[0x401225] /lib64/libc.so.6(__libc_start_main+0xf3)[0x7f951de251a3] ./try-bt(_start+0x2e)[0x4010ae] *** Program: /* save as try-bt.c then compile with: cc -rdynamic -fno-omit-frame-pointer -g -std=3Dc99 -o try-bt try-bt.c -fno-= inline -lexecinfo -lelf */ #include #include #include #include #include static void dump_trace(int sig) { size_t max_frames =3D 32; void *buffer[max_frames]; size_t calls =3D backtrace(buffer, max_frames); fprintf(stderr, "Signal %d in dump_trace - have %zu frames\n", sig, calls); backtrace_symbols_fd(buffer, calls, 2); _Exit(EXIT_FAILURE); } void boom() { volatile char *a =3D 0; *a =3D 17; } void two() {boom(); } void one() {two(); } int main(void) { signal(SIGSEGV, dump_trace); one(); exit(EXIT_SUCCESS); } /* END */ --=20 You are receiving this mail because: You are the assignee for the bug.=