Closed
Bug 858723
Opened 12 years ago
Closed 12 years ago
[OS.File] File 0 will not work
Categories
(Toolkit Graveyard :: OS.File, defect)
Toolkit Graveyard
OS.File
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla23
People
(Reporter: Yoric, Assigned: Yoric)
References
Details
Attachments
(1 file, 5 obsolete files)
13.80 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
In the async version of OS.File, osfile_async_worker.js gives a unique number to each file, used to communicate with osfile_async_front.jsm.
In osfile_async_front.jsm, however, we consistently check |if (filenum)| or |if (!filenum)| to ensure that |filenum != null|. This doesn't work if |filenum == 0|.
I have no idea why no test ever caught his, but we need to fix this quickly.
Assignee | ||
Comment 1•12 years ago
|
||
Actually, this seems a little less widespread than I thought.
The first file we open (and only the first file):
- cannot be closed;
- cannot be stat()-ed.
Still, we need to fix this.
Assignee | ||
Comment 2•12 years ago
|
||
Assignee: nobody → dteller
Attachment #734024 -
Flags: review?(nfroyd)
![]() |
||
Comment 3•12 years ago
|
||
Comment on attachment 734024 [details] [diff] [review]
Fixing File 0
Review of attachment 734024 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/osfile/tests/xpcshell/xpcshell.ini
@@ +1,5 @@
> [DEFAULT]
> head =
> tail =
>
> +[test_osfile_closed.js]
|hg add| is your friend.
Attachment #734024 -
Flags: review?(nfroyd) → review-
Assignee | ||
Comment 4•12 years ago
|
||
Oops
Attachment #734024 -
Attachment is obsolete: true
Attachment #735122 -
Flags: review?(nfroyd)
![]() |
||
Comment 5•12 years ago
|
||
Comment on attachment 735122 [details] [diff] [review]
Fixing File 0, v2
Review of attachment 735122 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/osfile/osfile_async_worker.js
@@ +42,5 @@
> options = data.args[data.args.length - 1];
> }
> // If |outExecutionDuration| option was supplied, start measuring the
> // duration of the operation.
> + if (options && typeof options === "object" && "outExecutionDuration" in options) {
Is this hunk supposed to be here?
Attachment #735122 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 6•12 years ago
|
||
I confess that it is a drive-by fix. I can split this 1-liner fix into another patch, if you prefer.
![]() |
||
Comment 7•12 years ago
|
||
(In reply to David Rajchenbach Teller [:Yoric] from comment #6)
> I confess that it is a drive-by fix. I can split this 1-liner fix into
> another patch, if you prefer.
Sneaky! I think it would be better to split it out into another patch (another bug, even).
Assignee | ||
Comment 8•12 years ago
|
||
Same patch, without the drive-by fix.
Attachment #735122 -
Attachment is obsolete: true
Attachment #735778 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
This doesn't apply cleanly to inbound. Please post an updated patch.
Keywords: checkin-needed
Assignee | ||
Comment 11•12 years ago
|
||
I haven't experienced any bitrot on inbound. Re-attaching the patch in case I had solved the issue already for some reason.
Attachment #735778 -
Attachment is obsolete: true
Attachment #738465 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 12•12 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 13•12 years ago
|
||
Backed out for mochitest-other failures.
https://hg.mozilla.org/integration/mozilla-inbound/rev/4bce3c7a0f9b
https://tbpl.mozilla.org/php/getParsedLog.php?id=21913722&tree=Mozilla-Inbound
07:38:37 INFO - 14827 INFO TEST-PASS | chrome://mochitests/content/chrome/toolkit/components/osfile/tests/mochi/test_osfile_async.xul | system_shutdown: File descriptors leaks are logged correctly.
07:38:37 INFO - 14828 ERROR TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/toolkit/components/osfile/tests/mochi/test_osfile_async.xul | system_shutdown: Leaked resource is correctly listed in the log.
Comment 14•12 years ago
|
||
This had xpcshell failures too.
https://tbpl.mozilla.org/php/getParsedLog.php?id=21916880&tree=Mozilla-Inbound
Assignee | ||
Comment 15•12 years ago
|
||
Ok, I believe that I have fixed the issue, which was actually due to another patch that landed in the meantime.
Try: https://tbpl.mozilla.org/?tree=Try&rev=cbf6e1f8bc10
Attachment #738465 -
Attachment is obsolete: true
Attachment #739250 -
Flags: review+
Assignee | ||
Comment 16•12 years ago
|
||
Same one, more testsuite fix.
Try: https://tbpl.mozilla.org/?tree=Try&rev=544c59b0d028
Attachment #739250 -
Attachment is obsolete: true
Attachment #739943 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 17•12 years ago
|
||
Keywords: checkin-needed
Comment 18•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Updated•2 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•