Closed Bug 971975 Opened 11 years ago Closed 11 years ago

crash in mozilla::net::CacheFile::IsDirty()

Categories

(Core :: Networking: Cache, defect)

x86
Windows NT
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mayhemer, Assigned: mayhemer)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file, 1 obsolete file)

This bug was filed from the Socorro interface and is report bp-d3c9ddfb-b735-4e88-980b-bb4c02140212. ============================================================= Apparently at [1] mMetadata can be null. Null check is sufficient IMO, I think it's possible we release a file w/o metadata. [1] http://hg.mozilla.org/mozilla-central/annotate/ecf20a2484b6/netwerk/cache2/CacheFile.cpp#l1311
Attached patch v1 (obsolete) — Splinter Review
Kinda trivial.
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #8375712 - Flags: review?(michal.novotny)
Comment on attachment 8375712 [details] [diff] [review] v1 Review of attachment 8375712 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/cache2/CacheFile.cpp @@ +181,1 @@ > WriteMetadataIfNeededLocked(true); We never null out mMetadata once we create a new one or from a the data in the entry file. So mMetadata can be null here only for non-ready CacheFile. It would be IMO better to check mReady here instead of mMetadata. Additional MOZ_ASSERT(mMetadata) in WriteMetadataIfNeededLocked() would be probably also good.
Attachment #8375712 - Flags: review?(michal.novotny) → review-
(In reply to Michal Novotny (:michal) from comment #2) > Comment on attachment 8375712 [details] [diff] [review] > v1 > > Review of attachment 8375712 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: netwerk/cache2/CacheFile.cpp > @@ +181,1 @@ > > WriteMetadataIfNeededLocked(true); > > We never null out mMetadata once we create a new one or from a the data in > the entry file. So mMetadata can be null here only for non-ready CacheFile. > It would be IMO better to check mReady here instead of mMetadata. Additional > MOZ_ASSERT(mMetadata) in WriteMetadataIfNeededLocked() would be probably > also good. I don't agree. This is about a crash non-null check that has to be 100% safe. If you want a check on the state then we should MOZ_ASSERT(mReady) in WriteMetadataIfNeededLocked() or somewhere. Sorry, but MOZ_ASSERT(mMetadata) in WriteMetadataIfNeededLocked() is a nonsense regarding fix for this bug. It has no effect in release at all, don't you think?
(In reply to Honza Bambas (:mayhemer) from comment #3) > I don't agree. This is about a crash non-null check that has to be 100% I also don't agree. If you want 100% safe check you need to do it in CacheFile::IsDirty() instead of in the destructor. > safe. If you want a check on the state then we should MOZ_ASSERT(mReady) in > WriteMetadataIfNeededLocked() or somewhere. Sorry, but > MOZ_ASSERT(mMetadata) in WriteMetadataIfNeededLocked() is a nonsense > regarding fix for this bug. It has no effect in release at all, don't you > think? Sure, it has no effect in release and that's why I suggest regular if check in the destructor.
Attached patch v2Splinter Review
- check for mReady in the dtor - in WriteMetadataIfNeededLocked: non-null check with MOZ_CRASH and return
Attachment #8375712 - Attachment is obsolete: true
Attachment #8375939 - Flags: review?(michal.novotny)
Attachment #8375939 - Flags: review?(michal.novotny) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: