Last Comment Bug 451506 - The return values of PR_Seek64 and PR_Available64 should be checked in FileImpl::Seek or else file corruption will occur
: The return values of PR_Seek64 and PR_Available64 should be checked in FileI...
Status: RESOLVED FIXED
: dataloss, fixed1.8.1.18
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: 1.8 Branch
: All All
: -- critical (vote)
: ---
Assigned To: Hiroyuki Ikezoe (:hiro)
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-20 23:24 PDT by Hiroyuki Ikezoe (:hiro)
Modified: 2008-10-20 18:22 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Check both values [Checkin: Comment 9] (1.48 KB, patch)
2008-08-20 23:26 PDT, Hiroyuki Ikezoe (:hiro)
benjamin: review+
neil: superreview+
dveditz: approval1.8.1.18+
Details | Diff | Splinter Review

Description Hiroyuki Ikezoe (:hiro) 2008-08-20 23:24:49 PDT
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 values of PR_Seek64 and PR_Available64 should be checked in  FileImpl::Seek or else file corruption will occur.

When call Seek(NS_SEEK_END, 0), if PR_Available64 fails then fileSize become wrong value. So file pointer does not move to end of file.




Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Hiroyuki Ikezoe (:hiro) 2008-08-20 23:26:43 PDT
Created attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]
Comment 2 Hiroyuki Ikezoe (:hiro) 2008-08-20 23:27:24 PDT
I suspect BUG 432514 was caused by this issue.
Comment 3 neil@parkwaycc.co.uk 2008-08-21 01:35:40 PDT
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

You need an XPCOM reviewer for this.
Comment 4 Benjamin Smedberg [:bsmedberg] 2008-08-25 08:49:56 PDT
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

r=me, although this code really just needs to die
Comment 5 Hiroyuki Ikezoe (:hiro) 2008-08-25 15:55:22 PDT
I agree. But Thunderbird 2.0.0.x still uses this code. I don't think that cleanup XPCOM/obsolete codes from Thunderbird is good for its stability.
Comment 6 Hiroyuki Ikezoe (:hiro) 2008-08-25 15:55:51 PDT
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

the patch will raise stability.
Comment 7 Samuel Sidler (old account; do not CC) 2008-08-27 01:49:47 PDT
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

This will have to get looked at in 1.8.1.18. We're frozen.
Comment 8 Daniel Veditz [:dveditz] 2008-09-22 11:27:29 PDT
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

Approved for 1.8.1.18, a=dveditz for release-drivers
Comment 9 Reed Loden [:reed] (use needinfo?) 2008-09-30 22:11:33 PDT
http://hg.mozilla.org/mozilla-central/rev/6601dacc93f7
Comment 10 Daniel Veditz [:dveditz] 2008-10-20 18:22:51 PDT
Patch checked into the 1.8 branch

Note You need to log in before you can comment on or make changes to this bug.