|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 2383 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 2383.
Report 2383 Actions
Problem Report Number 2383 Submitter's Classification Specification problem State Resolved Resolution Permanent Interpretation (PIN) Problem Resolution ID PIN.X.0267 Raised 2004-05-27 00:18 Updated 2004-06-29 23:45 Published 2004-06-29 23:45 Product Standard Sockets (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 5.2.4 Test Identification /tset/CAPI.os/sockets/listen/T.listen 2
/tset/CAPI.os/sockets/connect/T.connect 3, 4, 5, 6, 7Specification Networking Services Issue 4 Location in Spec connect(), listen() Problem Summary V1 (UNIX95) version of spec does not make clear that the intention is
for connections to be considered as established before they are
accepted.Problem Text In VSU5.2.3 and later a change was made to use blocking connect()
calls when filling the listen queue, which is causing us to get
an UNRESOLVED result for listen #2 and connect #3-7 because for
AF_UNIX sockets the connect() call being made to fill the listen
queue is blocking, which results in the alarm from SET_ALARM(connto+1)
going off and the connect() fails with EINTR.
The spec states:
"If the initiating socket is connection-mode, then connect() shall
attempt to establish a connection to the address specified by
the address argument. If the connection cannot be established
immediately and O_NONBLOCK is not set for the file descriptor
for the socket, connect() shall block for up to an unspecified
timeout interval until the connection is established."
Our implementation of connect() for AF_UNIX sockets interpreted the
word "established" to mean that the connection has been accepted by
the server, not simply that the connection was placed on the server's
backlog queue. Consequently, on our AF_UNIX implementation, a sequence
of blocking mode connect()s cannot be used to fill the backlog of a
server who is ignoring the listening socket. This is the reason
the first connect() times out.
Our AF_INET & AF_UNIX implementations were developed independently
of one another, and our AF_INET implementation does not behave the
same as AF_UNIX in this regard.
We feel that there is a gray area in the UNIX95 (Issue 4) spec
(the version this was coded to) in that it does not precisely
define socket session establishment, other than that the
socket becomes writable when the connection is completed. We
interpreted establishment to mean that the client was actually in
conversation with the server.
The spec does not make clear that the intention is for connections
to be considered as established before they are accepted.
This has been somewhat clarified as the speicification evolved.
The SUSv2 spec adds the following paragragh to the listen() description:
"The implementation may include incomplete connections
in the queue subject to the queue limit. The implementation
may also increase the specified queue limit internaly if it
includes such incomplete connection in the queue subject
to this limit."
and the SUSv3 spec rewords this to be:
"The implementation may include incomplete connections in its
listen queue. The limits on the number of incomplete connections
and completed connections queued may be different."
The fact that the clarification was added in later vesions of the
spec supports our argument that the wording was not very clear.Test Output 400|397 3 1 14:52:12|IC Start
200|397 3 14:52:12|TP Start
520|397 3 00050462902 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|397 3 00050462902 1 2|TEST: AF_INET SOCK_STREAM
520|397 3 00050462902 1 3|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 4385
520|397 3 00050462902 2 1|PREP: Create three sockets
520|397 3 00050462902 2 2|PREP: Wait for child to be ready
520|397 3 00050462902 2 3|PREP: Connect once or twice to fill queue
520|397 3 00050462902 2 4|PREP: Notify child to delay and then accept
520|397 3 00050462902 2 5|TEST: connect blocks until connection accepted
520|397 3 00050462902 2 6|TEST: Duration of blocking
520|397 3 00050462902 2 7|CLEANUP: Close sockets
520|397 3 00050462902 2 8|TEST: AF_UNIX SOCK_STREAM
520|397 3 00050462902 2 9|PREP: Create test sockaddr_un: path
= ../tmp/unix.aCCHxQ
520|397 3 00016908513 1 1|PREP: Child: create socket
520|397 3 00016908513 1 2|PREP: Child: bind to socket
520|397 3 00016908513 1 3|PREP: Child: listen on socket with backlog of
1
520|397 3 00016908513 1 4|PREP: Child: tell parent ready
520|397 3 00016908513 1 5|PREP: Child: wait for parent to become ready
520|397 3 00016908513 1 6|PREP: Child: delay
520|397 3 00016908513 1 7|PREP: Child: accept connections
520|397 3 00050462902 3 1|PREP: Create three sockets
520|397 3 00050462902 3 2|PREP: Wait for child to be ready
520|397 3 00050462902 3 3|PREP: Connect once or twice to fill queue
520|397 3 00050462902 3 4|ERROR: connect (first) failed, errno = 120
(EINTR - Interrupted function)
520|397 3 00033685729 1 1|PREP: Child: create socket
520|397 3 00033685729 1 2|PREP: Child: bind ../tmp/unix.aCCHxQ to socket
520|397 3 00033685729 1 3|PREP: Child: listen on socket with backlog of
1
520|397 3 00033685729 1 4|PREP: Child: tell parent ready
520|397 3 00033685729 1 5|PREP: Child: wait for parent to become ready
220|397 3 2 14:56:10|UNRESOLVED
410|397 3 1 14:56:10|IC End
400|397 4 1 14:56:10|IC Start
200|397 4 14:56:10|TP Start
520|397 4 00084017355 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|397 4 00084017355 1 2|TEST: AF_INET SOCK_STREAM
520|397 4 00084017355 1 3|INFO: RETRY - bind to address = 9.12.17.223,
port = 741 failed with errno = 111 (EACCES - Permission denied)
520|397 4 00084017355 1 4|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 1046
520|397 4 00084017355 2 1|PREP: Create three sockets
520|397 4 00084017355 2 2|PREP: Wait for child to be ready
520|397 4 00084017355 2 3|PREP: Connect once or twice to fill queue
520|397 4 00084017355 2 4|PREP: Set long alarm
520|397 4 00084017355 2 5|TEST: connect blocks until timeout elapses
520|397 4 00084017355 2 6|TEST: Return value and errno
520|397 4 00084017355 2 7|TEST: Blocked for correct interval
520|397 4 00084017355 2 8|CLEANUP: Close sockets, end child
520|397 4 00084017355 2 9|INFO: Notify waiting child
520|397 4 00084017355 2 10|TEST: AF_UNIX SOCK_STREAM
520|397 4 00084017355 2 11|PREP: Create test sockaddr_un: path
= ../tmp/unix.bBgExQ
520|397 4 00084017377 1 1|PREP: Child: create socket
520|397 4 00084017377 1 2|PREP: Child: bind to socket
520|397 4 00084017377 1 3|PREP: Child: listen on socket with backlog of
1
520|397 4 00084017377 1 4|PREP: Child: tell parent ready
520|397 4 00084017377 1 5|PREP: Child: wait for parent to complete
520|397 4 00084017377 1 6|CLEANUP: Child: close socket
520|397 4 00084017355 3 1|PREP: Create three sockets
520|397 4 00084017355 3 2|PREP: Wait for child to be ready
520|397 4 00084017355 3 3|PREP: Connect once or twice to fill queue
520|397 4 00084017355 3 4|ERROR: connect (first) failed, errno = 120
(EINTR - Interrupted function)
520|397 4 00067240118 1 1|PREP: Child: create socket
520|397 4 00067240118 1 2|PREP: Child: bind to socket
520|397 4 00067240118 1 3|PREP: Child: listen on socket with backlog of
1
520|397 4 00067240118 1 4|PREP: Child: tell parent ready
520|397 4 00067240118 1 5|PREP: Child: wait for parent to complete
220|397 4 2 15:03:11|UNRESOLVED
410|397 4 1 15:03:11|IC End
400|397 5 1 15:03:11|IC Start
200|397 5 15:03:11|TP Start
520|397 5 00084017280 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|397 5 00084017280 1 2|TEST: AF_INET SOCK_STREAM
520|397 5 00084017280 1 3|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 62733
520|397 5 00084017280 2 1|PREP: Create three sockets
520|397 5 00084017280 2 2|PREP: Wait for child to be ready
520|397 5 00084017280 2 3|PREP: Connect once or twice to fill queue
520|397 5 00084017280 2 4|TEST: connect blocks until interrupted
520|397 5 00084017280 2 5|TEST: Duration of blocking
520|397 5 00084017280 2 6|PREP: Notify child to accept
520|397 5 00084017280 2 7|TEST: Await notification connections completed
520|397 5 00084017280 2 8|TEST: AF_UNIX SOCK_STREAM
520|397 5 00084017280 2 9|PREP: Create test sockaddr_un: path
= ../tmp/unix.DgfcxQ
520|397 5 00033685528 1 1|PREP: Child: create socket
520|397 5 00033685528 1 2|PREP: Child: bind to socket
520|397 5 00033685528 1 3|PREP: Child: listen on socket with backlog of
1
520|397 5 00033685528 1 4|PREP: Child: tell parent ready
520|397 5 00033685528 1 5|PREP: Child: wait for parent to become ready
520|397 5 00033685528 1 6|PREP: Child: accept connections
520|397 5 00033685528 1 7|PREP: Child: notify parent connections
completed
520|397 5 00033685528 1 8|PREP: Child: wait for parent to complete test
520|397 5 00084017280 3 1|PREP: Create three sockets
520|397 5 00084017280 3 2|PREP: Wait for child to be ready
520|397 5 00084017280 3 3|PREP: Connect once or twice to fill queue
520|397 5 00084017280 3 4|ERROR: connect (first) failed, errno = 120
(EINTR - Interrupted function)
520|397 5 00050462744 1 1|PREP: Child: create socket
520|397 5 00050462744 1 2|PREP: Child: bind to socket
520|397 5 00050462744 1 3|PREP: Child: listen on socket with backlog of
1
520|397 5 00050462744 1 4|PREP: Child: tell parent ready
520|397 5 00050462744 1 5|PREP: Child: wait for parent to become ready
220|397 5 2 15:07:09|UNRESOLVED
410|397 5 1 15:07:09|IC End
400|397 6 1 15:07:09|IC Start
200|397 6 15:07:09|TP Start
520|397 6 00084017236 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|397 6 00084017236 1 2|TEST: AF_INET SOCK_STREAM
520|397 6 00084017236 1 3|INFO: RETRY - bind to address = 9.12.17.223,
port = 709 failed with errno = 111 (EACCES - Permission denied)
520|397 6 00084017236 1 4|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 1046
520|397 6 00084017236 2 1|PREP: Create three sockets
520|397 6 00084017236 2 2|PREP: Wait for child to be ready
520|397 6 00084017236 2 3|PREP: Connect once or twice to fill queue
520|397 6 00084017236 2 4|PREP: Set O_NONBLOCK
520|397 6 00084017236 2 5|TEST: connect returns with EINPROGRESS
520|397 6 00084017236 2 6|TEST: Did not block
520|397 6 00084017236 2 7|PREP: Notify child to accept
520|397 6 00084017236 2 8|TEST: Await notification connections completed
520|397 6 00084017236 2 9|TEST: AF_UNIX SOCK_STREAM
520|397 6 00084017236 2 10|PREP: Create test sockaddr_un: path
= ../tmp/unix.FBchxQ
520|397 6 00016908487 1 1|PREP: Child: create socket
520|397 6 00016908487 1 2|PREP: Child: bind to socket
520|397 6 00016908487 1 3|PREP: Child: listen on socket with backlog of
1
520|397 6 00016908487 1 4|PREP: Child: tell parent ready
520|397 6 00016908487 1 5|PREP: Child: wait for parent to become ready
520|397 6 00016908487 1 6|PREP: Child: accept connections
520|397 6 00016908487 1 7|PREP: Child: notify parent connections
completed
520|397 6 00016908487 1 8|PREP: Child: wait for parent to complete test
520|397 6 00084017236 3 1|PREP: Create three sockets
520|397 6 00084017236 3 2|PREP: Wait for child to be ready
520|397 6 00084017236 3 3|PREP: Connect once or twice to fill queue
520|397 6 00084017236 3 4|ERROR: connect (first) failed, errno = 120
(EINTR - Interrupted function)
520|397 6 00033685703 1 1|PREP: Child: create socket
520|397 6 00033685703 1 2|PREP: Child: bind to socket
520|397 6 00033685703 1 3|PREP: Child: listen on socket with backlog of
1
520|397 6 00033685703 1 4|PREP: Child: tell parent ready
520|397 6 00033685703 1 5|PREP: Child: wait for parent to become ready
220|397 6 2 15:11:07|UNRESOLVED
410|397 6 1 15:11:07|IC End
400|397 7 1 15:11:07|IC Start
200|397 7 15:11:07|TP Start
520|397 7 00067239958 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|397 7 00067239958 1 2|TEST: AF_INET SOCK_STREAM
520|397 7 00067239958 1 3|INFO: RETRY - bind to address = 9.12.17.223,
port = 641 failed with errno = 111 (EACCES - Permission denied)
520|397 7 00067239958 1 4|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 1046
520|397 7 00067239958 2 1|PREP: Create three sockets
520|397 7 00067239958 2 2|PREP: Wait for child to be ready
520|397 7 00067239958 2 3|PREP: Connect once or twice to fill queue
520|397 7 00067239958 2 4|PREP: Set O_NONBLOCK
520|397 7 00067239958 2 5|TEST: connect returns with EINPROGRESS
520|397 7 00067239958 2 6|TEST: Did not block
520|397 7 00067239958 2 7|TEST: connect returns with EALREADY
520|397 7 00067239958 2 8|CLEANUP: Close sockets, kill child
520|397 7 00067239958 2 9|TEST: AF_UNIX SOCK_STREAM
520|397 7 00067239958 2 10|PREP: Create test sockaddr_un: path
= ../tmp/unix.fbHexQ
520|397 7 00016908327 1 1|PREP: Child: create socket
520|397 7 00016908327 1 2|PREP: Child: bind to socket
520|397 7 00016908327 1 3|PREP: Child: listen on socket with backlog of
1
520|397 7 00016908327 1 4|PREP: Child: tell parent ready
520|397 7 00016908327 1 5|PREP: Child: wait for parent to complete test
520|397 7 00067239958 3 1|PREP: Create three sockets
520|397 7 00067239958 3 2|PREP: Wait for child to be ready
520|397 7 00067239958 3 3|PREP: Connect once or twice to fill queue
520|397 7 00067239958 3 4|ERROR: connect failed, errno = 120 (EINTR -
Interrupted function)
520|397 7 00033685543 1 1|PREP: Child: create socket
520|397 7 00033685543 1 2|PREP: Child: bind to socket
520|397 7 00033685543 1 3|PREP: Child: listen on socket with backlog of
1
520|397 7 00033685543 1 4|PREP: Child: tell parent ready
520|397 7 00033685543 1 5|PREP: Child: wait for parent to complete test
220|397 7 2 15:15:01|UNRESOLVED
410|397 7 1 15:15:01|IC End
400|427 2 1 15:17:46|IC Start
200|427 2 15:17:46|TP Start
520|427 2 00067239990 1 1|PREP: Get VSU_CONNECT_TIMEOUT configuration
variable
520|427 2 00067239990 1 2|TEST: AF_INET SOCK_STREAM
520|427 2 00067239990 1 3|PREP: Create test sockaddr_in: address =
9.12.17.223, port = 65421
520|427 2 00067239990 2 1|PREP: Wait for child to be ready
520|427 2 00067239990 2 2|PREP: Create a socket
520|427 2 00067239990 2 3|TEST: First connect succeeds
520|427 2 00067239990 2 4|PREP: Create a socket
520|427 2 00067239990 2 5|TEST: connect either succeeds, times out or
is rejected
520|427 2 00067239990 2 6|TEST: Return value and errno
520|427 2 00067239990 2 7|PREP: Create a socket
520|427 2 00067239990 2 8|TEST: connect either succeeds, times out or
is rejected
520|427 2 00067239990 2 9|TEST: Return value and errno
520|427 2 00067239990 2 10|CLEANUP: Close sockets, kill child
520|427 2 00067239990 2 11|TEST: AF_UNIX SOCK_STREAM
520|427 2 00067239990 2 12|PREP: Create test sockaddr_un: path
= ../tmp/unix.bACFxQ
520|427 2 00033685687 1 1|PREP: Child: create socket
520|427 2 00033685687 1 2|PREP: Child: bind to socket
520|427 2 00033685687 1 3|PREP: Child: listen on socket with backlog of
2
520|427 2 00033685687 1 4|PREP: Child: tell parent ready
520|427 2 00033685687 1 5|PREP: Child: wait for parent to complete test
520|427 2 00033685687 1 6|CLEANUP: Child: close socket
520|427 2 00067239990 3 1|PREP: Wait for child to be ready
520|427 2 00067239990 3 2|PREP: Create a socket
520|427 2 00067239990 3 3|TEST: First connect succeeds
520|427 2 00067239990 3 4|ERROR: connect failed, errno = 120 (EINTR -
Interrupted function)
520|427 2 00050462903 1 1|PREP: Child: create socket
520|427 2 00050462903 1 2|PREP: Child: bind to socket
520|427 2 00050462903 1 3|PREP: Child: listen on socket with backlog of
2
520|427 2 00050462903 1 4|PREP: Child: tell parent ready
520|427 2 00050462903 1 5|PREP: Child: wait for parent to complete test
220|427 2 2 15:24:42|UNRESOLVED
410|427 2 1 15:24:42|IC End
Review Information
Review Type SA Review Start Date 2004-05-27 00:18 Last Updated 2004-06-02 02:53 Completed 2004-06-02 02:53 Status Complete Review Resolution No Resolution Given Review Conclusion It is recommended that this PR be forwarded for expert review.
The consultant gave the following opinion:-
The purpose of the additions in SUSv2 and SUSv3 appears to have been to
clarify the situation for incomplete connections. I.e. it clarifies
that implementations are also allowed to count incomplete connections in
the queue limit, not just complete ones. As a side-effect, these
additions also clarify that the queue does contain completed
("established") connections for which accept() has not yet been called.
I think there is little doubt that this was also the intention in SUSv1,
because the specification was just describing what was already very
widespread existing practice, but since the specification does not
explicitly say so, this matter should be forwarded for expert group review.
Review Type Expert Group Review Start Date 2004-06-02 02:12 Last Updated 2004-06-29 23:44 Completed 2004-06-29 23:44 Status Complete Review Resolution Permanent Interpretation (PIN) Review Conclusion This issue was discussed in the Base Working Group.
It appears that the specification is too loosely worded to be able to
enforce it. It is also thought that allowing a different semantic is
unlikely to break existing applications.
A Permanent Interpretation is therefore recommended.
Problem Reporting System Options:
- View Report 2383
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority