Closed
Bug 721582
Opened 13 years ago
Closed 13 years ago
We should probably use a strong assert for target in AsyncExecuteStatements::execute
Categories
(Toolkit :: Storage, defect)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: espindola, Assigned: espindola)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
Going all to way to execution to find out that an underlying connection went away would be an strange API. It is better to use higher level logic (like one of the xpcom or profile change messages) and don't create the statement in the first place.
Assignee | ||
Comment 1•13 years ago
|
||
An initial try push is at
https://tbpl.mozilla.org/?tree=Try&rev=d56a6d4b0d54
Comment 2•13 years ago
|
||
Shouldn't there be other changes in storage too? Since MOZ_ASSERT is a no-op in non-debug builds, it seems like your change either creates a possible null-pointer dereference in storage or the assert and the ensure-true are already superfluous...
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Andrew Sutherland (:asuth) from comment #2)
> Shouldn't there be other changes in storage too? Since MOZ_ASSERT is a
> no-op in non-debug builds, it seems like your change either creates a
> possible null-pointer dereference in storage or the assert and the
> ensure-true are already superfluous...
They are unlikely to be hit right now. The reason is that we don't normally wait for tasks to run during shutdown. I found this failing while trying to fix that. Now that I think of it, this bug should probably depend on 721603, not the other way around.
No longer blocks: 721603
Assignee | ||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
I still think the code would be saner if we'd still "if (!target) {return NS_ERROR_NOT_AVAILABLE}" after moz_assert, we can always make mistakes that may unluckily not be noticed soon enough in the cycle.
That said having a fatal assertion instead of a weak warning is a win. Could you add any meaningful comment to the assert to help figuring out what may have gone wrong in the code change?
Assignee | ||
Comment 6•13 years ago
|
||
I added comment and a reference to a bug that assert found.
Attachment #597972 -
Attachment is obsolete: true
Attachment #597972 -
Flags: review?(mak77)
Attachment #599187 -
Flags: review?(mak77)
Comment 7•13 years ago
|
||
though, this still doesn't reintroduce the null check. an ad-on may hit the same bug and crash us in opt builds, the assert wouldn't protect us.
Assignee | ||
Comment 8•13 years ago
|
||
My preference is for the previous version, as crashes are fairly well behaved bugs. If we must have keep the if, this patch does it.
Attachment #599187 -
Attachment is obsolete: true
Attachment #599187 -
Flags: review?(mak77)
Attachment #599287 -
Flags: review?(mak77)
Comment 9•13 years ago
|
||
Comment on attachment 599287 [details] [diff] [review]
new patch
Review of attachment 599287 [details] [diff] [review]:
-----------------------------------------------------------------
if this is protecting a developer error the assert is fine, crashing users may help finding it earlier, but it's not usually nice vs the users, imo.
Attachment #599287 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 10•13 years ago
|
||
A new try is at
https://tbpl.mozilla.org/?tree=Try&rev=291bc14461c2
Mak, given the resolution for 728653, is your r+ still standing?
Comment 11•13 years ago
|
||
sure, this doesn't change the behavior, just makes the error visible to us.
Assignee | ||
Comment 12•13 years ago
|
||
looks like i found a bug already. Debugging :-(
Assignee | ||
Comment 13•13 years ago
|
||
A new try push is at
https://tbpl.mozilla.org/?tree=Try&rev=1eeb55426b70
Assignee | ||
Comment 14•13 years ago
|
||
Comment 15•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in
before you can comment on or make changes to this bug.
Description
•