public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mcermak at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/18649] New: int_arg() misbehaves on x86[_64] for 32-bit uprobe in binary having debuginfo
Date: Thu, 09 Jul 2015 09:29:00 -0000	[thread overview]
Message-ID: <bug-18649-6586@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2015-07-09  9:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09  9:29 mcermak at redhat dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18649-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).