The default bug view has changed. See this FAQ.

Make it a compile-time error to have a script-implementable interface with more methods than xptcall stubs can handle

RESOLVED FIXED in mozilla8

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bz, Assigned: jcranmer)

Tracking

unspecified
mozilla8
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

xptcall is capped at something like 249 methods.  I ran into that today with some DOM interfaces and orange builds.... but that code should just have not compiled instead of dying on pure virtual calls, imo.
(Assignee)

Comment 1

6 years ago
I have a patch which:
1. Causes an error with xpidl
2. Prevents the interface from being loaded with xpt

(un)Fortunately, nsIDOMCSS2Properties has 469 methods on my machine, so it's a good check to make sure that we actually fail hard in these cases.
(Assignee)

Comment 2

6 years ago
Created attachment 551089 [details] [diff] [review]
First cut

This is a first cut at the bug. bz suggested over IRC that I elide the check in case of builtinclass interfaces. Since the real problem is over whether or not in can be stubbed, I'm also going to track down the stub generation code and make that fail.
Assignee: nobody → Pidgeot18
Status: NEW → ASSIGNED
(Assignee)

Comment 3

6 years ago
http://dxr.mozilla.org/mozilla/mozilla-central/xpcom/reflect/xptcall/src/xptcall.cpp.html#l69

Builtinclasses already fail the stub generation, so there shouldn't be a problem to failing to load that xpt file.
(Assignee)

Comment 4

6 years ago
Created attachment 551103 [details] [diff] [review]
Patch, version 1

This omits the error in case of builtinclass.
Attachment #551089 - Attachment is obsolete: true
Attachment #551103 - Flags: review?(benjamin)
(In reply to Boris Zbarsky (:bz) from comment #0)
> xptcall is capped at something like 249 methods.  I ran into that today with
> some DOM interfaces and orange builds.... but that code should just have not
> compiled instead of dying on pure virtual calls, imo.

When you say 'xptcall' is capped, you mean the stubs, and not NS_InvokeByIndex, right?
I mean the stubs, yes.
Summary: Make it a compile-time error to have an interface with more methods than xptcall can handle → Make it a compile-time error to have an interface with more methods than xptcall stubs can handle
Summary: Make it a compile-time error to have an interface with more methods than xptcall stubs can handle → Make it a compile-time error to have a script-implementable interface with more methods than xptcall stubs can handle
Attachment #551103 - Flags: review?(benjamin) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Just a few days, and I can't import this to m-i atm, clearing checkin-needed until patch is updated.
Keywords: checkin-needed
(Assignee)

Comment 8

6 years ago
I refreshed the patch and pushed to mozilla-inbound...
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/16107d140423
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.