From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22010 invoked by alias); 20 Aug 2013 20:13:41 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 21978 invoked by uid 48); 20 Aug 2013 20:13:40 -0000 From: "jsm28 at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug libc/15868] New: backtrace interfaces and calls to noreturn functions Date: Tue, 20 Aug 2013 20:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.18 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jsm28 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00122.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15868 Bug ID: 15868 Summary: backtrace interfaces and calls to noreturn functions Product: glibc Version: 2.18 Status: NEW Severity: normal Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: jsm28 at gcc dot gnu.org CC: drepper.fsp at gmail dot com Created attachment 7155 --> http://sourceware.org/bugzilla/attachment.cgi?id=7155&action=edit Testcase The backtrace / backtrace_symbols / backtrace_symbols_fd interfaces do not work well when backtracing through calls to noreturn functions (a natural use case - a noreturn error-handling function might reasonably wish to print a backtrace). This is illustrated by the attached testcase on x86_64. At least with some GCC versions, the call to a noreturn function has return address pointing to padding after the end of the calling function, meaning that it does not point inside that function and so a name for it cannot be found. The backtrace interface is that the addresses are return addresses. But reliable backtracing requires additional information about whether frames are signal frame, in which case the return address points inside the relevant function, or not, in which case you should subtract 1 to be sure of being inside the relevant function. (That involves calling _Unwind_GetIPInfo instead of _Unwind_GetIP to get the relevant information.) So to support this case reliably, there should be new interfaces that handle this adjustment in some way. (Old discussion started at: http://www.eglibc.org/archives/patches/msg01077.html .) -- You are receiving this mail because: You are on the CC list for the bug.