Closed
Bug 451169
Opened 17 years ago
Closed 12 years ago
The return value of FileImpl::InternalFlush() should be checked or else file corruption will occur
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: hiro, Assigned: hiro)
Details
(Keywords: dataloss)
Attachments
(1 file)
3.64 KB,
patch
|
benjamin
:
review+
benjamin
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080702 Ubuntu/8.04 (hardy) Firefox/2.0.0.15 Kazehakase/0.5.4
Build Identifier:
The return value of FileImpl::InternalFlush() should be checked or else file corruption will occur.
Possible scenario
1. some data wrote by FileImpl::Write().
2. called FileImpl:Seek()
3. FileImpl::InternalFlush() was called from FileImpl:Seek().
4. some buffer were written and some were not written since PR_Write() was failed.
5. called FileImpl::Write()
6. file data became corruption since all buffer remained even if InternalFlush() was failed.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Assignee | ||
Comment 1•17 years ago
|
||
Check the return value of InternalFlush and cleanup buffer if InternalFlush is failed.
Attachment #334443 -
Flags: superreview?(benjamin)
Attachment #334443 -
Flags: review?(brendan)
Assignee | ||
Comment 2•17 years ago
|
||
I think the return value of seek() should be checked as well but seek is invoked here and there...
Assignee | ||
Updated•17 years ago
|
Comment 3•17 years ago
|
||
Comment on attachment 334443 [details] [diff] [review]
Proposed patch
I'd feel happier if you just removed the clients of this code so we could stop building it in all configurations.
Attachment #334443 -
Flags: superreview?(benjamin)
Attachment #334443 -
Flags: superreview+
Attachment #334443 -
Flags: review?(brendan)
Attachment #334443 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Attachment #334443 -
Flags: approval1.8.1.next?
Comment 4•16 years ago
|
||
David, Dan: does Thunderbird use this code?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•16 years ago
|
Assignee: nobody → poincare
Comment 5•16 years ago
|
||
2.0x most likely does, 3.0x does not.
Comment 6•16 years ago
|
||
I'm somewhat inclined to take this, because it would appear to be a serious bug. However, I'm a bit leery of the risk that are other callers of this code that aren't expecting errors in these circumstances and might behave poorly (eg crash; stomp memory) if they crop up. It's hard to figure out how to balance these risks without knowing more:
* has this ever been sighted in the wild in Thunderbird?
* can we get steps to reproduce?
* what error-handling code paths are taken by other in-tree callers?
Keywords: qawanted
Comment 7•16 years ago
|
||
Comment on attachment 334443 [details] [diff] [review]
Proposed patch
Clearing approval request.
Please renominate when the questions from comment 6 are addressed.
Attachment #334443 -
Flags: approval1.8.1.next?
Comment 8•12 years ago
|
||
I assume Wayne cc'd me for a comment.
Based on comment 5, this fix is for versions of the code that are no longer shipping, so I assume that means the bug is now either WONTFIX or INVALID.
(It modifies files in mozilla/xpcom/obsolete)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 9•11 years ago
|
||
Issue is Resolved - removing QA-Wanted Keywords - QA-Wanted query clean-up task
Keywords: qawanted
You need to log in
before you can comment on or make changes to this bug.
Description
•