public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/18649] New: int_arg() misbehaves on x86[_64] for 32-bit uprobe in binary having debuginfo
@ 2015-07-09  9:29 mcermak at redhat dot com
  2015-07-09  9:32 ` [Bug tapsets/18649] " mcermak at redhat dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: mcermak at redhat dot com @ 2015-07-09  9:29 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=18649

            Bug ID: 18649
           Summary: int_arg() misbehaves on x86[_64] for 32-bit uprobe in
                    binary having debuginfo
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

The int_arg() function doesn't work correctly on i[36]86 and x86_64 when
probing 32-bit userspace application having debuginfo compiled in. Let's have
following program:

=======
int                                                                             
testfc(int arg)                                                                 
{                                                                               
    return arg;                                                                 
}                                                                               

int                                                                             
main()                                                                          
{                                                                               
    testfc(32767);                                                              
    return 0;                                                                   
}
=======

and probe it using following stap command:

=======
stap -e 'probe process("a.out").function("testfc") {printf("%x\n",
int_arg(1))}' -c ./a.out
=======

Following example demonstrates int_arg() returning nonsense value when 32-bit
binary having debuginfo is being traced:

=======
 7.2 S x86_64 # cat test.c
int
testfc(int arg)
{
    return arg;
}

int
main()
{
    testfc(32767);
    return 0;
}


 7.2 S x86_64 # gcc 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 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 -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 # 
=======

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-04  7:47 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09  9:29 [Bug tapsets/18649] New: int_arg() misbehaves on x86[_64] for 32-bit uprobe in binary having debuginfo mcermak at redhat dot com
2015-07-09  9:32 ` [Bug tapsets/18649] " mcermak at redhat dot com
2015-07-09 15:50 ` jistone at redhat dot com
2015-07-10 20:45 ` mcermak at redhat dot com
2015-07-10 20:57 ` mcermak at redhat dot com
2015-07-10 21:47 ` jistone at redhat dot com
2015-07-13 14:38 ` dsmith at redhat dot com
2015-07-13 16:52 ` jistone at redhat dot com
2015-07-21 14:10 ` mcermak at redhat dot com
2015-07-29 16:29 ` mcermak at redhat dot com
2015-08-14 19:07 ` dsmith at redhat dot com
2015-08-21  7:49 ` mcermak at redhat dot com
2015-08-21 13:50 ` dsmith at redhat dot com
2015-08-21 17:42 ` jistone at redhat dot com
2015-08-31  8:22 ` mcermak at redhat dot com
2015-09-01  7:36 ` mcermak at redhat dot com
2015-09-04  7:47 ` mcermak at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).