|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1493 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 1493.
Report 1493 Actions
Problem Report Number 1493 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0775 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1995-08-25 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.0.2 Test Identification fmmap/mmap 3 Problem Summary TSD4U.00038 Test mandates mapping with PROT_EXEC for writable files, spec does not require this. Problem Text
This test calls a library routine, create_exex_file() with
"O_RDWR" flag and then call mmap() to map in the file with
"PROT_EXEC" flag. Because HP's implementation does not
allow mapping a file for execution when the file is currently
open for writing. The mmap() call fails with errno set to
ETXTBSY. HP's implementation does not violate the standards
since no such condition is described on the CASPEC pages. So
HP filed a waiver request classifying this as a test error.
The request was rejected and the response was:
> Our opinion differs.
> Although we can find nothing in the spec to forbid the behavior
> you describe, we believe the intent was to support PROT_ALL
> in a MAP_SHARED environment (this being necessary to allow
> an efficient means of producing self modifying code).
> We believe LISP vendors in particular will depend on this.
> With this in mind, we are reluctant to change the test without
> further direction from X/Open.
> If you would like to pursue this further we suggest you file
> an interpretation request with X/Open. If they rule in your
> favor we will be happy to align the test with their decision.
We do not agree with the response. UNIX has NEVER allowed to
open an executable file for write while it is being executed.
The case cited regarding LISP is also not true. LISP switches
data memory to executable memory and back again but NEVER
expects to be able to write in to the memory while it is
executing. This limitation is common architectural requirement
on most, if not all computer architectures.
Lastly, as the response stated, the spec does not restrict the
behavior described and as such no conformance distinction should
be made based upon unspecified behavior in the spec.Test Output
SECTION: Discrete Tests
TEST CASE: mmap
TEST PURPOSE #3
A successful call to void *mmap(void *addr, size_t
len, int prot, int flags, int fildes, off_t off) when
fildes is associated with a regular file, the
MAP_SHARED flag is set in flags, and the PROT_EXEC
flag is set in prot shall map len bytes at offset off
in the memory object represented by fildes into the
address space of the process, allow the mapped area to
be executed, and return the location in the address
space at which the mapping is made.
PREP: Obtain the system page size by call to
sysconf(_SC_PAGESIZE)
PREP: Establish signal handlers for SIGSEGV
PREP: Open a file and initialize it
PREP: Now set proper permissions and re-open file
TEST: mmap() with MAP_SHARED returns the address
where object is mapped
ERROR: Call to mmap() failed.
3 FAILReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
This issue comes down to whether or not the specification
intended to mandate an environment that supports self modifying
code.
The quoted opinion above states our objection to this request.
We remember helping LISP vendors try to debug data/instruction
cache coherency problems in a PROT_ALL MAP_SHARED environment.
This plus the fact that other implementations pass the test as it
is currently written indicates there are implementations that
intend support for self modifying code.
LISP vendors are aware that switching data memory to executable
memory and back again is an alternative to a MAP_SHARED PROT_ALL
environment. We have been told they consider this less
efficient, much slower and more difficult to implement than
a MAP_SHARED PROT_ALL environment.
We recommend this request be refused.
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. The test suite is assuming more
than is in the text of the specification.
Problem Reporting System Options:
- View Report 1493
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority