|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1266 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1266.
Report 1266 Actions
Problem Report Number 1266 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0548 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1999-03-03 08:00 Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98) Certification Program The Open Brand certification program Test Suite VSU version 5.0.3 Test Identification CAPIbase/mmap 41 Problem Summary TSD4U.00270 This test may fail as it does not pass the correct limits to setrlimit. Problem Text
In PG4U.00161, the consultants stated the following:
"We believe this test is correct as written. Before calling mmap() the
test sets RLIMIT_FSIZE beyond the small off_t such that the addresses
used are valid for the file."
The code in t41lrgoff.c looks like this.
if (getrlimit(RLIMIT_FSIZE, &save) != 0) {
reply.status = UNRESOLVED;
sprintf(reply.reason, "In LFS program: getrlimit() with RLIMIT_F
SIZE failed, errno = %d(%s)", errno, strerror(errno));
reply.errnum = 0;
if(write(1, &reply, sizeof(reply)) != sizeof(reply))
exit(99);
if(write(1, "\n", 1) != 1)
exit(99);
exit(1);
}
limitsModified = 0;
if ((save.rlim_max == RLIM_INFINITY) &&
(save.rlim_cur != RLIM_INFINITY)) {
setrlp.rlim_cur = (rlim_t)MAXOFF_VAL(small_offt)+OFF_TRLIMIT;
setrlp.rlim_max = save.rlim_max;
limitsModified = 1;
}
else {
if (!((save.rlim_max == RLIM_INFINITY) && (save.rlim_cur == RLIM
_INFINITY))) {
setrlp.rlim_cur = (rlim_t)MAXOFF_VAL(small_offt)+OFF_TRLIMIT;
setrlp.rlim_max = (rlim_t)MAXOFF_VAL(small_offt)+OFF_TRLIMIT;
limitsModified = 1;
}
}
if (limitsModified) {
errno = 0;
if (setrlimit(RLIMIT_FSIZE, &save) != 0) {
There are two problems with this code;
1) It appears that it was intended to use setrlp to change the rlimits.
However, the setrlimit() call doesn't change anything as it uses the initial
values from the getrlimit() call.
2) If save.rlim_max and save.rlim_cur are both equal to RLIM_INFINITY, then
setrlp is not set and setrlimit() is not called.
In addition, the macro for MAXOFF_VAL(or its use) is incorrect. It is
defined as
#define MAXOFF_VAL(x) pow((double)2, (double)((x*8)-1))-1
and it is used as
offset = (off_t)((MAXOFF_VAL(small_offt)/pgsz)*pgsz+pgsz);
When the macro is expanded by the preprocessor, the line looks like this
offset = (off_t)((pow((double)2, (double)((x*8)-1))-1/pgsz)*pgsz+pgsz);
The 1/pgsz will take precedence over the "-" operation. Adding ()s to the
definition or around the MAXOFF_VAL() in the "offset =" line will fix this.Test Output
------- output from system running in 32 BIT mode -----------------
TEST CASE: mmap
TEST PURPOSE #41
EOVERFLOW in errno and return MAP_FAILED on a call to
void *mmap(void *addr, size_t len, int prot, int
flags, int fildes, off_t off) when file is a regular
file and the value of off plus len exceeds the offset
maximum established in the open file description
associated with fildes.
PREP: Check for existence of programming environments
PREP: Obtain off_t size in XBS5_ILP32_OFF32 environment
PREP: Obtain off_t size in XBS5_ILP32_OFFBIG environment
INFO: Execution environment for XBS5_LP64_OFF64 not supported
INFO: Execution environment for XBS5_LPBIG_OFFBIG not supported
TEST: Execute a program compiled in XBS5_ILP32_OFF32(32-bit off_t)
environment that:
opens a regular file for writing
execs a program compiled in XBS5_ILP32_OFFBIG(64-bit off_t) environment,
passing it the open file descriptor
this program:
verifies mmap returns -1 and sets errno to
EOVERFLOW when off+len exceeds the offset maximum
ERROR: In LFS program: errno set incorrectly. Expected: EOVERFLOW (127), Received: 6
41 FAIL
------- output from system running in 64 BIT mode -----------------
TEST CASE: mmap
TEST PURPOSE #41
EOVERFLOW in errno and return MAP_FAILED on a call to
void *mmap(void *addr, size_t len, int prot, int
flags, int fildes, off_t off) when file is a regular
file and the value of off plus len exceeds the offset
maximum established in the open file description
associated with fildes.
PREP: Check for existence of programming environments
PREP: Obtain off_t size in XBS5_ILP32_OFF32 environment
PREP: Obtain off_t size in XBS5_ILP32_OFFBIG environment
PREP: Obtain off_t size in XBS5_LP64_OFF64 environment
PREP: Obtain off_t size in XBS5_LPBIG_OFFBIG environment
TEST: Execute a program compiled in XBS5_ILP32_OFF32(32-bit off_t)
environment that:
opens a regular file for writing
execs a program compiled in XBS5_ILP32_OFFBIG(64-bit off_t) environment,
passing it the open file descriptor
this program:
verifies mmap returns -1 and sets errno to
EOVERFLOW when off+len exceeds the offset maximum
ERROR: In LFS program: errno set incorrectly. Expected: EOVERFLOW (127), Received
: 6
TEST: Execute a program compiled in XBS5_ILP32_OFF32(32-bit off_t)
environment that:
opens a regular file for writing
execs a program compiled in XBS5_LP64_OFF64(64-bit off_t) environment,
passing it the open file descriptor
this program:
verifies mmap returns -1 and sets errno to
EOVERFLOW when off+len exceeds the offset maximum
ERROR: In LFS program: errno set incorrectly. Expected: EOVERFLOW (127), Received
: 6
TEST: Execute a program compiled in XBS5_ILP32_OFF32(32-bit off_t)
environment that:
opens a regular file for writing
execs a program compiled in XBS5_LPBIG_OFFBIG(64-bit off_t) environment,
passing it the open file descriptor
this program:
verifies mmap returns -1 and sets errno to
EOVERFLOW when off+len exceeds the offset maximum
ERROR: In LFS program: errno set incorrectly. Expected: EOVERFLOW (127), Received
: 6
Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We agree this is a test suite deficiency in the test suite version(s)
listed.
Please note this is based on submitter's issue 1 only.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency. This applies to issue 1.
above only.
Problem Reporting System Options:
- View Report 1266
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority