Closed Bug 469745 Opened 16 years ago Closed 2 years ago

PR_Shutdown fails with errno = ENOTCONN on Mac OS X 10.5 Leopard.

Categories

(NSPR :: NSPR, defect, P2)

All
macOS
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE
4.10.4

People

(Reporter: wtc, Unassigned)

Details

Attachments

(1 file)

The shutdown() call in PR_Shutdown sometimes fails with errno = ENOTCONN
on Mac OS X 10.5 Leopard.  This causes the NSPR tests cltsrv, layer,
nblayer, provider, and socket to fail.  This bug was first reported by
Glen in bug 370766 comment 5 and later by me in bug 370766 comment 24.
It affects both 32-bit i386 and 64-bit x86_64 builds.

This could be an OS bug (a regression in Mac OS X 10.5).
Kai: have you seen these errors from PR_Shutdown on the Mac OS X build bots?

On Mac OS X, ENOTCONN is now reported by shutdown() with SHUT_RD or SHUT_RDWR
(both of which shut down the reading) if the peer has done a TCP half close
(sent a TCP FIN packet) on the connection.
Attachment #8365621 - Flags: review?(kaie)
I forgot to mention an alternative workaround.

Several NSPR test programs call PR_Shutdown(PR_SHUTDOWN_BOTH)
before closing the socket. If we change PR_SHUTDOWN_BOTH to
PR_SHUTDOWN_SEND (which does a TCP half close), we can also
avoid the ENOTCONN error from shutdown() on Mac OS X.

But I think it is better to suppress this error inside
PR_Shutdown.
I've never seen such failures. We aren't running the NSPR tests on the buildbot, and also didn't run them on tinderbox. See also the email I've just sent. Let's discuss which tests we should enable (in email).
I've ran the NSPR tests on both OSX machines that we're using for NSS buildbot testing,
using:
  perl ./nspr/pr/tests/runtests.pl

All tests reported "Passed", including the tests you have mentioned, on both OSX machines (which run 10.5.8 and 10.6.8).

Maybe the bug has been fixed in OSX and this workaround is no longer required?
Comment on attachment 8365621 [details] [diff] [review]
Ignore ENOTCONN for shutdown(SHUT_RD) and shutdown(SHUT_RDWR) on Mac OS X

clearing review request, as the patch might be unnecessary.

Please rerequest review if you still want it.
Attachment #8365621 - Flags: review?(kaie)
Kai: thank you for testing. I will repeat my test on the latest
version of Mac OS X (10.9.2) and get back to you.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 4.10.4

The bug assignee didn't login in Bugzilla in the last 7 months and this bug has priority 'P2'.
:KaiE, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: wtc → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(kaie)
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(kaie)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: