public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/15961] New: nd_syscall.exp failure on i686
@ 2013-09-16 21:30 dsmith at redhat dot com
  2013-10-17 14:27 ` [Bug tapsets/15961] " dsmith at redhat dot com
  2013-10-17 21:25 ` dsmith at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2013-09-16 21:30 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 15961
           Summary: nd_syscall.exp failure on i686
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com

The nd_syscall.exp testcase gets a failure on i686 RHEL6
(2.6.32-358.18.1.el6.i686) in the 'trunc' test:

  FAIL: 32-bit trunc nd_syscall

This failure is because systemtap is getting the wrong value for the 'length'
convenience variable from the nd_syscall.truncate probe. Here's the source for
nd_syscall.truncate:

====
probe nd_syscall.truncate = kprobe.function("sys_truncate") ?,
                            kprobe.function("sys_truncate64") ?
{
    name = "truncate"
    // path_uaddr = $path
    // path = user_string($path)
    // length = $length
    // argstr = sprintf("%s, %d", user_string_quoted($path), $length)
    asmlinkage()
    path_uaddr = pointer_arg(1)
    path = user_string_quoted(path_uaddr)
    if (symname(addr()) == "sys_truncate")
        length = ulong_arg(2)
    else
        length = longlong_arg(2)
    argstr = sprintf("%s, %d", user_string_quoted(path_uaddr), length)
}
====

The problem here was that a probe on "sys_truncate" was installed, but
'symname(addr())' failed, so that the wrong value was grabbed for 'length'.

'symname(addr())' shouldn't have failed, but that's a lot of work to do just to
figure out which function is being called. A call to 'ppfunc()' might be better
or breaking down the probe a bit more like the following (untested):

====
probe nd_syscall.truncate = __nd_syscall.truncate ?, __nd_syscall.truncate64 ?
{
    name = "truncate"
    // path_uaddr = $path
    // path = user_string($path)
    // length = $length
    // argstr = sprintf("%s, %d", user_string_quoted($path), $length)
    asmlinkage()
    path_uaddr = pointer_arg(1)
    path = user_string_quoted(path_uaddr)
    argstr = sprintf("%s, %d", user_string_quoted(path_uaddr), length)
}
probe __nd_syscall.truncate = kprobe.function("sys_truncate")
{
    asmlinkage()
    length = ulong_arg(2)
}
probe __nd_syscall.truncate64 = kprobe.function("sys_truncate64")
{
    asmlinkage()
    length = longlong_arg(2)
}
====

Note that there are 3 other similar uses of 'symname(addr())' in the nd_syscall
tapset files.

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

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

end of thread, other threads:[~2013-10-17 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16 21:30 [Bug tapsets/15961] New: nd_syscall.exp failure on i686 dsmith at redhat dot com
2013-10-17 14:27 ` [Bug tapsets/15961] " dsmith at redhat dot com
2013-10-17 21:25 ` dsmith 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).