This is the mail archive of the 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 testsuite/4088] New: syscall.mmap test is using create() but tests for open()

The mmap test in testsuite/systemtap.syscall is using creat() but is testing for
the open() syscall.

>From mmap.c
/* create a file with something in it */
 fd = creat("foobar",S_IREAD|S_IWRITE);
 // open ("foobar", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 4

This works on i386 I think because glibc just calls open().   On s390 this is
not the case, sys_creat is really called.  
The compiler has optimized sys_creat so that sys_open() has been inlined.  So
you never see the call to sys_open.

Running the test:  test.tcl mmap  produces:
mmap: mprotect (0x0000020000187000, 12288, PROT_READ) = 0
mmap: mprotect (0x000002000001d000, 4096, PROT_READ) = 0
mmap: munmap (0x0000020000020000, 63065) = 0
mmap: creat ("foobar", O_RDONLY, 0600) = 4       <<<  not what is expected
mmap: lseek (4, 1024, SEEK_SET) = 1024
mmap: write (4, "abcdef", 6) = 6
mmap: close (4) = 0

Can the test be changed to just use open() not creat().  This way it should run
on all platforms.

           Summary: syscall.mmap test is using create() but tests for open()
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: dwilder at us dot ibm dot com

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

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