From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95129 invoked by alias); 10 Mar 2015 20:45:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 95057 invoked by uid 48); 10 Mar 2015 20:45:06 -0000 From: "ian at airs dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug go/64999] s390x libgo test failure in TestMemoryProfiler Date: Tue, 10 Mar 2015 20:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: go X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ian at airs dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ian at airs dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg01164.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64999 --- Comment #49 from Ian Lance Taylor --- libbacktrace returns the line number that you actually care about: the line number of the call instruction. There is no question that that is correct. You say that it is a problem if the PC does not match the line number, but to me that sounds like a conceptual problem. What is the actual problem? The pprof.go code expects to get the PC after the call instruction, and tries to turn it into the PC of the call instruction. I think we can all agree that pprof.go should in fact see the PC after the call instruction. The simple way to do that is for callback in libgo/runtime/go-callers.c to increment pc before storing it in loc->pc. Apparently there is some problem with that but I do not know what that problem is. The additional argument I mentioned would be for the function types backtrace_fulL_callback and backtrace_simple_callback defined in libbacktrace/backtrace.h. The additional argument would be, essentially, the value of ip_before_insn in libbacktrace/backtrace.c and libbacktrace/simple.c. The argument would tell you whether the PC follows a call instruction, or whether it is the correct PC for a signal frame instruction.