Closed
Bug 971975
Opened 11 years ago
Closed 11 years ago
crash in mozilla::net::CacheFile::IsDirty()
Categories
(Core :: Networking: Cache, defect)
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: mayhemer, Assigned: mayhemer)
References
Details
(Keywords: crash)
Crash Data
Attachments
(1 file, 1 obsolete file)
1.32 KB,
patch
|
michal
:
review+
mayhemer
:
checkin+
|
Details | Diff | Splinter Review |
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
Assignee | ||
Comment 1•11 years ago
|
||
Kinda trivial.
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #8375712 -
Flags: review?(michal.novotny)
Comment 2•11 years ago
|
||
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-
Assignee | ||
Comment 3•11 years ago
|
||
(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?
Comment 4•11 years ago
|
||
(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.
Assignee | ||
Comment 5•11 years ago
|
||
- 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)
Updated•11 years ago
|
Attachment #8375939 -
Flags: review?(michal.novotny) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8375939 [details] [diff] [review]
v2
https://hg.mozilla.org/integration/mozilla-inbound/rev/4bae2b5cb32a
Attachment #8375939 -
Flags: checkin+
Comment 7•11 years ago
|
||
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.
Description
•