Closed Bug 495441 Opened 15 years ago Closed 15 years ago

pyxpcom chokes on NULL pointers as out params

Categories

(Other Applications Graveyard :: PyXPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

(status1.9.1 .3-fixed)

RESOLVED FIXED
mozilla1.9.2a1
Tracking Status
status1.9.1 --- .3-fixed

People

(Reporter: tomeu, Assigned: tomeu)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/8.10 (intrepid) Firefox/3.0.10
Build Identifier: mozilla hg changeset 28829:bb4148c7ff61

This is a problem because C++ code in mozilla calls methods that can be implemented in python passing NULL to the params it's not interested in. The C++ side expects that the call will succeed and that the non-null params will be correctly populated. Instead, it's aborting with an error:

NS_ABORT_IF_FALSE(pi->IsDipper() || ns_v.val.p, "No space for result!");

An example of this situation is when the implementation of nsDocShellTreeOwner::GetSize calls ownerWin->GetDimensions passing nsnull for the position arguments.

Reproducible: Always
We don't have a good component for PyXPCOM, moving to core:general.
Component: XPCOM → General
QA Contact: xpcom → general
Comment on attachment 380422 [details] [diff] [review]
first try
[Checkin: Comment 7 & 11]

Not sure who could review this. Trying with bsmedberg because he has reviewed patches to that file before.
Attachment #380422 - Flags: review?(benjamin)
Component: General → PyXPCOM
Product: Core → Other Applications
QA Contact: general → pyxpcom
Attachment #380422 - Flags: review?(benjamin) → review?(toddw)
Ping. If we get this patch committed to HEAD, it will be easier for us to ask distros to add it to what they currently ship until a release is made. Thanks!
@Tomeu

Note that PyXPCOM no longer resides in the main Mozilla 1.9.2 repository, it is now moved to:
  http://hg.mozilla.org/pyxpcom/

The patch itself looks fine, though could you also include a test case (testing both JS and Python), see these files:
  http://hg.mozilla.org/pyxpcom/file/d17d29dc2184/xpcom/test/test_component/py_test_component.idl
  http://hg.mozilla.org/pyxpcom/file/d17d29dc2184/xpcom/test/test_test_component.py
  http://hg.mozilla.org/pyxpcom/file/d17d29dc2184/xpcom/test/test_test_component.js
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 380422 [details] [diff] [review]
first try
[Checkin: Comment 7 & 11]

Turns out this is only testable when calling from a C++ code in to a Python implemented XPCOM component (which we don't have any test interfaces setup for).
Attachment #380422 - Flags: review?(toddw) → review+
Fixed: http://hg.mozilla.org/pyxpcom/rev/bc5fc8710ca9
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Is it possible this patch can be back ported to Mozilla 1.9.2 and 1.9.1 branches?

Note: This is not a part of xulrunner/firefox default builds.
Keywords: checkin-needed
(In reply to comment #5)
> Note that PyXPCOM no longer resides in the main Mozilla 1.9.2 repository

(In reply to comment #8)
> Is it possible this patch can be back ported to Mozilla 1.9.2 and 1.9.1
> branches?

1.9.2 seems N/A...
Assignee: nobody → tomeu
Whiteboard: [c-n: m-1.9.1]
Version: unspecified → Trunk
Right, please apply to the 1.9.1 branch.
Comment on attachment 380422 [details] [diff] [review]
first try
[Checkin: Comment 7 & 11]


http://hg.mozilla.org/releases/mozilla-1.9.1/rev/3fc2cdb2e18d
Attachment #380422 - Attachment description: first try → first try [Checkin: Comment 7 & 11]
Keywords: checkin-needed
Whiteboard: [c-n: m-1.9.1]
Target Milestone: --- → mozilla1.9.2a1
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: