Closed
Bug 196653
Opened 23 years ago
Closed 15 years ago
PyXPCOM does not return a valid interface pointer when returning an array from interface.
Categories
(Other Applications Graveyard :: PyXPCOM, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: den, Unassigned)
References
Details
Attachments
(1 file)
|
2.44 KB,
patch
|
twhitema
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
Build Identifier: Mozilla 1.02
Whenever there is an interface method returning an array of interfaces
implemented in Python (using PyXPCOM), it seems that PyXPCOM does not take the
interface type into consideration and returns just a list of plain nsISupports
pointers. The explicit call of QueryInterface on these pointers helps it. This
is what Mark Hammond answered me in comp.lang.python (thanks a lot by the way):
>Yes, this is a bug in pyxpcom. Specifically, it seems that we ignore
>the IID for arrays. The function FillSingleArray in VariantUtils.cpp
>isn't passed the IID, and it should be.
Reproducible: Always
Steps to Reproduce:
1. create an interface A with one of methods returning an array of interfaces B
2. implement this interface A as a Python component and return Python list of
(e.g. Python) objects implementing the interface B.
3. obtain the results
4. try to call any function of the interface B (not going to work)
4.5. call A::QueryInterface(B) and use it (as a workaround)
Actual Results:
depends on the actual interfaces and their implementations. If you haven't done
step (4.5), most likely you are going to get a crash via protection violation
Expected Results:
call the method correctly without the additional step (4.5)
I was using standalone XPCOM
| Reporter | ||
Updated•23 years ago
|
Version: Trunk → 1.0 Branch
Comment 1•23 years ago
|
||
This is mine, mine I tell you!
Assignee: dougt → mhammond
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•21 years ago
|
||
I think we should roll ShaneC's patch for never returning NULL for an array into
this too.
Status: NEW → ASSIGNED
Updated•20 years ago
|
QA Contact: scc → xpcom
Updated•17 years ago
|
Assignee: mhammond → nobody
Component: XPCOM → PyXPCOM
Product: Core → Other Applications
QA Contact: xpcom → pyxpcom
Version: 1.0 Branch → unspecified
Comment 3•16 years ago
|
||
This is a mass change. Every comment has "assigned-to-new" in it.
I didn't look through the bugs, so I'm sorry if I change a bug which shouldn't be changed. But I guess these bugs are just bugs that were once assigned and people forgot to change the Status back when unassigning.
Status: ASSIGNED → NEW
Comment 4•15 years ago
|
||
Actually, it looks like Python is returning the right result; it's on the other side that things fail - we assume all returning interfaces are nsISupports rather than whatever was indicated on the IDL. That breaks the interface flattening, and therefore things go bad.
Attachment #549479 -
Flags: review?(toddw)
Updated•15 years ago
|
Attachment #549479 -
Flags: review?(toddw) → review+
Comment 5•15 years ago
|
||
Push in change:
http://hg.mozilla.org/pyxpcom/rev/e263b3d21ad2
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•