From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117886 invoked by alias); 9 Jul 2015 15:50:02 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 117845 invoked by uid 48); 9 Jul 2015 15:49:58 -0000 From: "jistone at redhat dot com" To: systemtap@sourceware.org Subject: [Bug tapsets/18649] int_arg() misbehaves on x86[_64] for 32-bit uprobe in binary having debuginfo Date: Thu, 09 Jul 2015 15:50:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: tapsets X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jistone at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: 2015-q3/txt/msg00026.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18649 Josh Stone changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jistone at redhat dot com --- Comment #2 from Josh Stone --- (In reply to Martin Cermak from comment #0) > 7.2 S x86_64 # gcc -m32 test.c > 7.2 S x86_64 # stap -e 'probe process("a.out").function("testfc") > {printf("%x\n", int_arg(1))}' -c ./a.out > 7fff > 7.2 S x86_64 # gcc -g -m32 test.c > 7.2 S x86_64 # stap -e 'probe process("a.out").function("testfc") > {printf("%x\n", int_arg(1))}' -c ./a.out > 804840a > 7.2 S x86_64 # My guess is that debuginfo is allowing our prologue analysis, which means the probe will actually be placed a few instructions in. Since the arguments are on the stack, and the prologue will have manipulated the stack, we're no longer looking at the right place for calling conventions. This might fail on x86_64 too for arguments >= 7. I don't have a suggested fix off hand. A script writer can get around this by preferring the debuginfo access anyway, like @choose_defined($arg, int_arg(1)). -- You are receiving this mail because: You are the assignee for the bug.