Closed
Bug 1704683
Opened 5 years ago
Closed 5 years ago
ScopedClose has a double-close bug
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
90 Branch
People
(Reporter: jld, Assigned: gerard-majax)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
If the close syscall fails with EINTR, it's a complicated situation:
- On HP-UX, allegedly, it was necessary to retry the call to prevent a leak
- On many other Unix varieties, the fd will be closed and the call must not be retried
- POSIX doesn't specify what happens
(In contrast, for every other syscall that can fail with EINTR, it's generally necessary to retry.)
See also https://crbug.com/269623 and bug 1278361 comment #3 where this was discussed with in the context of Chromium's code and our downstream copy, and bug 1278361 comment #10 for details about macOS. In summary, every Unix we support will close the fd in this case.
So, the code that was added in bug 818106 could in theory cause a double-close bug, and close an unrelated fd opened concurrently by another thread, if it's interrupted by a signal (e.g., by the profiler on Linux).
This is simple to fix: remove the retry loop.
Updated•5 years ago
|
Keywords: regression
| Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Pushed by alissy@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ffd2bbd5d0e
Avoid loop for closing fd r=jld
Comment 3•5 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox90:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Updated•5 years ago
|
Updated•5 years ago
|
Has Regression Range: --- → yes
You need to log in
before you can comment on or make changes to this bug.
Description
•