Closed Bug 719695 Opened 12 years ago Closed 11 years ago

in pyXPCOM a failing QueryInterface for a client invalidates all names used in the non supported interface

Categories

(Other Applications Graveyard :: PyXPCOM, defect)

1.9.2 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: danielfriederich, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7

Steps to reproduce:

in pyXPCOM, with an native object implementing some interface (e.g. nsIArray).
nsIArray contains a length length attribute, reading it from python works fine.
When QueryInterface for another interface which is not supported by the object, but which does also provide a length attribute.
After this, reading the length attribute fails. Python attempts to use the non supported interface when accessing the field.
In my original case, interfaces did form a hierarchy.

scriptable, uuid(bc3173bd-aa46-46a0-9d25-d9867a9659b6)]
interface ISample1 : nsISupports
{
  readonly attribute long length;
};
scriptable, uuid(2AF664C0-3CBE-41da-B240-0D43F1ACE86E)]
interface ISample2 : ISample1 
{
  readonly attribute long somethingElse;
};
A native object only implements ISample1. Accessing ISample1.length works fine from python until a QI for ISample2 is attempted on the object. From then on pyxpcom QI's for ISample2 to access length, and that fails.


Actual results:

a accessible field suddenly becomes inaccessible after a QueryInterface.


Expected results:

QI should not invalidate accesses.
Hi!
Sorry about missing this bug when I fixed things in https://hg.mozilla.org/pyxpcom/rev/3be9a7c623ce - we now have a test to hopefully avoid this in the future.\

I should have searched for existing bugs harder; didn't see it when I went for a fix :(
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: