Closed Bug 1309681 Opened 8 years ago Closed 3 years ago

NSPR pipes became non-blocking by default

Categories

(NSPR :: NSPR, defect)

4.13
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dwmw2, Assigned: dragana)

References

Details

Attachments

(1 file, 1 obsolete file)

The patch applied to address bug 1289145 had the effect of making pipes non-blocking by default — which was noted in that bug and an alternative fix proposed, but 4.13 shipped with this incompatible change anyway. It broke Firefox's automatic NTLM single-sign-on under Linux, because it doesn't cope with getting -EAGAIN when reading from a pipe to the ntlm_auth helper process. https://bugzilla.redhat.com/show_bug.cgi?id=1383918
I assume the change we've made is this: https://hg.mozilla.org/projects/nspr/rev/c5f7511ed27673f72c9b4bef15b4e476bc98f402 Dragana, there are two more NSPR patches from Wan-Teh in bug 1289145, that seem (at the first look only!) like an alternative solution potentially fixing both bug 1289145 and this bug. If we don't want to accept those, could we export an API to set the nonblocking flag on secret and use it only for the pollable event? (It seems like the patch at [1] is doing exactly that..) [1] https://bugzilla.mozilla.org/attachment.cgi?id=8790334&action=diff
Flags: needinfo?(dd.mozilla)
Blocks: 1289145
(In reply to Honza Bambas (:mayhemer) from comment #1) > I assume the change we've made is this: > https://hg.mozilla.org/projects/nspr/rev/ > c5f7511ed27673f72c9b4bef15b4e476bc98f402 > > Dragana, there are two more NSPR patches from Wan-Teh in bug 1289145, that > seem (at the first look only!) like an alternative solution potentially > fixing both bug 1289145 and this bug. > > If we don't want to accept those, could we export an API to set the > nonblocking flag on secret and use it only for the pollable event? (It > seems like the patch at [1] is doing exactly that..) > > [1] https://bugzilla.mozilla.org/attachment.cgi?id=8790334&action=diff On solution is to use a socket pair on unix as well, but I prefer not to use it. The second solution [1] means that we need to use PR_NewPollableEvent, which complicates our PollableEvent and probably need rewriting a large portion of it. So I think the solution is to expose _PR_MakePipeNonblock(PRFileDesc *fd) function. In the patch [1] it is an internal function. I will make a patch.
Flags: needinfo?(dd.mozilla)
Assignee: nobody → dd.mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached patch bug_1309681.patch (obsolete) — Splinter Review
Attachment #8800687 - Flags: review?(wtc)
We should assume that there are multiple consumers of NSPR, and that Firefox isn't the only one. It would be best to restore the original behavior of NSPR, which avoids the regression, and the original bug 1289145 should get fixed in a different way.
Depends on: 1311366
Comment on attachment 8800687 [details] [diff] [review] bug_1309681.patch You shouldn't implement PR_MakePipeNonblock twice. Please remove one from one of the .c files. A better name might be PR_SetPipeNonblocking. Would it be a better API to allow the caller to specify a parameter, that selects between blocking and nonblocking? Should optimized builds fail, if the function is called for a non-pipe fd, instead of only debug-build assertion?
Blocks: 1314915
incorporate comment #5.
Attachment #8800687 - Attachment is obsolete: true
Attachment #8800687 - Flags: review?(wtc)
Attachment #8807124 - Flags: review?(wtc)
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: