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/16058] New: syscall.mmap/nd_syscall.mmap probe alias problem


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

            Bug ID: 16058
           Summary: syscall.mmap/nd_syscall.mmap probe alias problem
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com

Bug #11388 pointed out a problem with syscall.mmap* probes on 2.6.33+ kernels.
The solutions was to switch to probing sys_mmap_pgoff() for those kernels.

I've found a bug in this transition. The last argument to mmap() is supposed to
be an offset in the file, and must be a multiple of the page size. But, for
mmap_pgoff() that offset is the number of pages.

So:

  mmap(..., 8192)

is equivalent to:

  mmap_pgoff(..., 2)

when the page size is 4k.

In the new syscall.mmap/nd_syscall.mmap probe alias using sys_mmap_pgoff(),
this difference isn't taken into account, and we're returning 2 instead of
8192.

This wasn't noticed since we don't have a test that calls mmap() with a
non-zero offset.

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