Open Bug 1213139 Opened 10 years ago Updated 3 years ago

PR Pollable Event (from PR_NewPollableEvent()) deadlock

Categories

(NSPR :: NSPR, defect)

defect

Tracking

(Not tracked)

People

(Reporter: mcmanus, Unassigned)

Details

a pollable event is comprised of 2 file descriptors connected either via a pipe or a localhost tcp socket. writing to one of them can be identified via poll on the other one (and then is cleared via read) these sides don't have to be matched 1:1 as with a semaphore - the read side actually reads between 1 and 1000 and ignores the number of signals consumed. the write side is a blocking fd and the buffering on the underlying fd is finite. in my test, the pipe has a 64KB buffer. (though I think this would vary by host and type of fd). though this size is not knowable. If buffersize + 1 PR_SetPollableEvent() calls are made before a PR_WaitForPollableEvent() that last SetPollableEvent() will block. If that happens to be the same thread responsible for polling() and calling pr_waitforpollableevent() then deadlock will ensue. its probably enough to make the write side non blocking to resolve this - but the PRFileDesc from pr_newpollableeventdoesn't expose setsockopt to let the application do that.

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: wtc → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.