Closed Bug 684758 Opened 13 years ago Closed 13 years ago

pt_ConnectContinue should also check for PR_POLL_HUP

Categories

(NSPR :: NSPR, defect, P1)

4.8.9
x86_64
FreeBSD

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flo, Assigned: flo)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch to fix the issue (obsolete) — Splinter Review
On FreeBSD when you try to connect to a Host/Port where nothing listens, i.e. the webserver is down, firefox goes into a loop and uses 100% CPU. This can easily be reproduced by connecting to http://localhost:randomport, where randomport is a port where no service is listening. Andriy Gapon tracked this down to pt_ConnectContinue in ptio.c of nspr. It should also check for PR_POLL_HUP. A patch is attached. With the attached patch we are not able to reproduce the problem anymore.
Attachment #558348 - Attachment is patch: true
Attachment #558348 - Flags: review?(wtc)
Thanks for the patch. NSPR expects poll() to report POLLOUT in this case, indicating the socket is writable. (The expected behavior is that a socket becomes both readable and writable if the connect failed.) I guess FreeBSD uses POLLHUP only to report that the socket is writable when the connect failed in this way. Patch checked in on the NSPR trunk (NSPR 4.9). Checking in ptio.c; /cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c,v <-- ptio.c new revision: 3.117; previous revision: 3.116 done
Attachment #558348 - Attachment is obsolete: true
Attachment #558348 - Flags: review?(wtc)
Assignee: wtc → flo
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Priority: -- → P1
Resolution: --- → FIXED
Target Milestone: --- → 4.9
Pushed to mozilla-central in the latest NSPR update: https://hg.mozilla.org/mozilla-central/rev/7e25caedd620
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: