This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/15961] New: nd_syscall.exp failure on i686


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]