|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1381 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 1381.
Report 1381 Actions
Problem Report Number 1381 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0663 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1996-09-18 08:00 Product Standard Sockets (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.0 Test Identification Sockets/accept 2 Problem Summary TSD4U.00154 This test may fail on implementations which place different alignment restrictions on character arrays and structures Problem Text
Although the SIGBUS failures are limited to the accept() and getpeername()
tests, a similar problem also exist in the getsockname() test #1, and
hence we are requesting the problem be addressed in all three tests.
The tests in question assume that an array of characters is aligned so
that it can cast a struct sockaddr_in (and a struct sockaddr_un) to the
array of characters and dereference the structure elements that are larger
than a character, such as the sin_addr field. The actual dereference
occurs in the checki() and checku() functions in the test suite capi_sock.a
library. Although this assumption might be valid on some computer systems,
it is inherently non-portable.
Many computer systems impose alignment restrictions on certain data types
and failing to obey the alignment restrictions can result in either a
run-time error or unexpected program behavior. However, using the C
language it is possible to violate the alignment restrictions by casting
pointers to different types. This test violates the alignment restriction
by casting a pointer to a different type.
A possible solution to this problem is to use malloc() for maximum
portability instead of static allocation of array of characters.
We verified that this pointer casting was the cause of the SIGBUS errors
by logically changing:
char buffer[sizeof(struct sockaddr_un)+128];
to
int buffer[(sizeof(struct sockaddr_un)+128)/4];
This ensures proper alignment for accessing struct sockaddr_in in our
implementation. We do not recommend this as a fix to the test suite,
but provide this example for illustrative purposes.Test Output
TEST CASE: accept
TEST PURPOSE #2
If the implementation supports a communications
domain and a connection-oriented socket type:
A call to int accept(int socket, struct sockaddr
*address, size_t *address_len) when address is not a
null pointer shall store the address of the peer for
the accepted connection in the sockaddr structure
pointed to by address and the length of this address
in the object pointed to by address_len.
TEST: AF_INET SOCK_STREAM
PREP: Create test sockaddr_in: address = 129.146.85.212, port = 3777
PREP: Child: wait for parent
PREP: Create a socket
PREP: Connect socket to address 129.146.85.212, port 3777
PREP: Child: wait for parent to complete
PREP: Create socket
PREP: Bind to socket
PREP: Call listen for socket
PREP: Signal child parent is ready
TEST: Call accept
PREP: getpeername for new descriptor
TEST: Size of returned address
TEST: Returned address
ERROR: TEST TERMINATED DUE TO SIGBUS SIGNAL (10)
TEST CASE: getpeername
TEST PURPOSE #1
If the implementation supports a communications
domain and a socket type:
A call to int getpeername(int socket, struct sockaddr
*address, size_t *address_len) shall store the peer
address of socket in the structure pointed to by
address, set the object pointed to by address_len to
the size of the name in bytes, and return 0.
TEST: AF_INET SOCK_STREAM
PREP: Create test sockaddr_in: address = 129.146.85.57, port = 1165
PREP: Server: create socket
PREP: Server: bind address 129.146.85.57, port 1165 to socket
PREP: Server: listen on socket
PREP: Server: notify client server is ready
PREP: Server: accept connection
INFO: Server: accepted connection from address 129.146.85.57, port 33744
PREP: echo_server: read and echo data
PREP: Wait for server to be ready
PREP: Create a socket
PREP: Connect socket to address 129.146.85.57, port 1165
TEST: Call getpeername
TEST: Return value
TEST: Size of returned address
TEST: Returned address
ERROR: TEST TERMINATED DUE TO SIGBUS SIGNAL (10)
1 FAILReview 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.
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.
Problem Reporting System Options:
- View Report 1381
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority