Last Comment Bug 658845 - "ABORT: Reset() expects non-null URI for referenced elem"
: "ABORT: Reset() expects non-null URI for referenced elem"
Status: RESOLVED FIXED
: assertion, regression, testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla6
Assigned To: Daniel Holbert [:dholbert]
:
Mentors:
Depends on:
Blocks: 308590
  Show dependency treegraph
 
Reported: 2011-05-21 22:14 PDT by Jesse Ruderman
Modified: 2011-06-01 12:27 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (asserts fatally when loaded) (120 bytes, image/svg+xml)
2011-05-21 22:14 PDT, Jesse Ruderman
no flags Details
stack trace (3.41 KB, text/plain)
2011-05-21 22:15 PDT, Jesse Ruderman
no flags Details
fix (1.41 KB, patch)
2011-05-21 23:40 PDT, Daniel Holbert [:dholbert]
roc: review+
Details | Diff | Splinter Review

Description Jesse Ruderman 2011-05-21 22:14:32 PDT
Created attachment 534272 [details]
testcase (asserts fatally when loaded)

###!!! ABORT: Reset() expects non-null URI for referenced elem: 'aURI', file content/base/src/nsReferencedElement.cpp, line 55

This abort was added in http://hg.mozilla.org/mozilla-central/rev/655514007ebd (bug 308590 patch 5).
Comment 1 Jesse Ruderman 2011-05-21 22:15:34 PDT
Created attachment 534273 [details]
stack trace
Comment 2 Daniel Holbert [:dholbert] 2011-05-21 22:20:45 PDT
The assert may very well be bogus.
Comment 3 Daniel Holbert [:dholbert] 2011-05-21 23:40:44 PDT
Created attachment 534278 [details] [diff] [review]
fix

(Confirmed in debug m-c build.)

Yeah, I think the assert is bogus.

Previously (before bug 308590), nsReferencedElement::Reset() began like so:
> 81   Unlink();
> 82 
> 83   nsCOMPtr<nsIURL> url = do_QueryInterface(aURI);
> 84   if (!url)
> 85     return;

I mistakenly assumed that line 84 there was simply a check for "Is aURI a nsIURL?", but turns out it was *also* serving the purpose of checking "Is aURI non-null".

Attached patch removes the bogus ABORT_IF_FALSE and restores a null-check early-return.  Also includes this bug's patch as a crash-test.
Comment 4 Robert O'Callahan (:roc) (email my personal email if necessary) 2011-05-22 15:23:17 PDT
Comment on attachment 534278 [details] [diff] [review]
fix

Review of attachment 534278 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 5 Daniel Holbert [:dholbert] 2011-05-22 16:25:07 PDT
http://hg.mozilla.org/projects/cedar/rev/96fae135f592
Comment 6 Matt Brubeck (:mbrubeck) 2011-05-23 08:47:04 PDT
http://hg.mozilla.org/mozilla-central/rev/96fae135f592
Comment 7 Daniel Holbert [:dholbert] 2011-05-31 14:12:31 PDT
Comment on attachment 534278 [details] [diff] [review]
fix

Requesting approval to land on aurora, as a followup to bug 308590.  

This is a trivial patch to fix a null-pointer crash. Includes crashtest.
Comment 8 Daniel Holbert [:dholbert] 2011-06-01 09:02:30 PDT
(In reply to comment #7)
> This is a trivial patch to fix a null-pointer crash. Includes crashtest.

(a _new_ null-pointer crash, that is)
Comment 9 Daniel Holbert [:dholbert] 2011-06-01 12:26:43 PDT
Gah, sorry -- I'm failing today at remembering whether things landed before or after the last aurora merge.  (I thought the merge was longer ago than it actually was.)

The checkin in comment 6 beat the merge, so this is already in aurora.

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