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] nd_syscall.exp failure on i686


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

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
I'm seeing a similar failure elsewhere (RHEL5 on s390x), that is a bit more
intermittent. The failure is in the 64-bit mmap nd_syscall test.

A mmap call that was supposed to match the following regexp:

===
mmap: mmap[2]* \([x0-9a-fA-F]+, 1030, PROT_READ, MAP_SHARED, [\-0-9]+,
[x0-9a-fA-F]+\) = [x0-9a-fA-F]+
====

came out like this:

====
mmap: mmap (0x0, 0, PROT_NON, MAP_PRIVATE, 0, 1) = 0x20000004000
====

I couldn't figure out how it was so wrong until I looked at the nd_syscall.mmap
probe alias source:

====
probe nd_syscall.mmap = kprobe.function("old_mmap") ?,
                        kprobe.function("old32_mmap") ?,
                        kprobe.function("SyS_s390_old_mmap") ?
{
    asmlinkage()
    if ((symname(addr()) == "old_mmap") || (symname(addr()) ==
"SyS_s390_old_mmap"))
        argstr = get_mmap_args(pointer_arg(1))
    else
        argstr = get_32mmap_args(pointer_arg(1))
}
====

If 'symname(addr())' fails, the probe defaults to using the 32-bit function,
which interpreted the 64-bit data as 32-bit data.

The following seems to fix the problem:

====
probe nd_syscall.mmap = __nd_syscall.mmap, __nd_syscall.mmap32
{
    name = "mmap"
}
probe __nd_syscall.mmap = kprobe.function("old_mmap") ?,
              kprobe.function("SyS_s390_old_mmap") ?
{
    asmlinkage()
    argstr = get_mmap_args(pointer_arg(1))
}
probe __nd_syscall.mmap32 = kprobe.function("old32_mmap") ?
{
    asmlinkage()
    argstr = get_32mmap_args(pointer_arg(1))
}
====

-- 
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]