Closed Bug 601251 Opened 14 years ago Closed 14 years ago

"ASSERTION: number doesn't implement required interface"

Categories

(Core :: SVG, defect)

x86
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- final+

People

(Reporter: jruderman, Assigned: longsonr)

References

Details

(Keywords: assertion, hang, testcase)

Attachments

(3 files, 2 obsolete files)

###!!! ASSERTION: number doesn't implement required interface: 'val', 
file content/svg/content/src/nsSVGNumberList.cpp, line 177
Attached file stack trace
We need to audit all these SVG methods where objects can be passed in and fix them. Jesse, if you find more issues with passing in a JS object literal can you just add the tests here rather than filing new bugs? An audit should sweep them all up, but it would be good to still have the tests to check.
This is actually different to the other interface stuff Jesse has found. We do have a test for the right object but it does the wrong thing. I think I have a patch for this one.
Ah, okay. Thanks Robert.
OK I was half right. The cause is the same as usual but it triggers a different set of symptoms as code elsewhere is different. That's why we get into a loop.
Attached patch patch (obsolete) — Splinter Review
Attachment #480503 - Flags: review?(jwatt)
This patch does numbers and point lists. That's all the list types done except for LengthList which works differently.
Comment on attachment 480503 [details] [diff] [review]
patch

You shouldn't use NS_ENSURE_SUCCESS since that will assert if it fails. I don't think you need to do the rv thing either, you can just null check. Something like this:

#define NS_ENSURE_NATIVE_NUMBER(obj, retval)                 \
  {                                                          \
    nsCOMPtr<nsISVGValue> val = do_QueryInterface(obj);      \
    if (!val) {                                              \
      *retval = nsnull;                                      \
      return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR);               \
    }                                                        \
  }

r=jwatt with the replacement of NS_ENSURE_SUCCESS with suitable code, whether the above or not. Thanks Robert!
Attachment #480503 - Flags: review?(jwatt) → review+
Attached patch patch (obsolete) — Splinter Review
This fixes the existing macros per the review comment. I can land the testcase as a crashtest.
Assignee: nobody → longsonr
Attachment #480503 - Attachment is obsolete: true
Attachment #480708 - Flags: approval2.0?
Should probably block since this causes the browser to hang.
blocking2.0: --- → ?
blocking2.0: ? → final+
Attachment #480708 - Flags: approval2.0?
Blocks: 603145
Attachment #480708 - Attachment is obsolete: true
Blocks: 499879
Keywords: checkin-needed
Whiteboard: [needs landing]
Landed: http://hg.mozilla.org/mozilla-central/rev/1792ad44c9d3
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing]
Target Milestone: --- → mozilla2.0b8
Flags: in-testsuite+
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: