Closed Bug 55384 Opened 24 years ago Closed 19 years ago

Memory leak, when try to invoke method with nsCIDRef parameter

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: avm, Assigned: blackconnect)

References

Details

Attachments

(1 file)

When try to call some method with argument of type "in nsCIDRef",
mozilla crashes.

How to reproduce:
Please apply attached diff to files in mozilla/java/xpcom/java/test directory.
(This diff add one parameter of type nsCIDRef to method test1 of bcIJavaSample 
interface)
then compile test,run mozilla  and note,
that mozilla crashed.


Reproduced with BC sources from 05/10/2000,
Mozilla PR3 build, Windows NT4.0
Resigning to Denis Sharypov 
Assignee: idk → sdv
I think it is working. Reporter will you please verify the bug?
I am suggesting to close this bug as a dupe for 71951
Reporter what do you say?
Will verify this bug with fresh build.
This bug can't be dup of 71951, but 
of course, it may be already fixed by fix for some other bug
Reporter, did you verify the bug?
Status: NEW → ASSIGNED
Reasingn to myself.
reporter will you please update the bug?
Assignee: sdv → idk
Status: ASSIGNED → NEW
Reporter, will you please update the bug?
I am going to close the bug as invalid
verified under Linux with latest sources.
Crash isn't more reproduced.
Method with "in nsCIDRef aClass" parameter 
("const nsCID & aClass" in CPP and "CID aClass" in Java).
If this method is implemented in CPP component and invoked 
from Java component, then all works well.
When this method is implemeted in Java and invoked from CPP component,
then exception thrown in console(please see below) and nothing more.

--bcJavaComponentFactory::CreateInstance
endDEbug:avm:bcJavaSample.test3(Object,CID)
java.lang.IllegalArgumentException: argument type mismatch
        at java.lang.reflect.Method.invoke(Native Method)
        at org.mozilla.xpcom.Utilities.callMethodByIndex(Utilities.java:57)
        at org.mozilla.xpcom.Utilities.callMethodByIndex(Native Method)
        at org.mozilla.xpcom.Utilities.callMethod(Utilities.java:75)
        at org.mozilla.xpcom.ProxyHandler.invoke(ProxyHandler.java:53)
        at $Proxy2.test3(Unknown Source)
        at bcJavaSample.test2(bcJavaSample.java:54)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.mozilla.xpcom.Utilities.callMethodByIndex(Utilities.java:57)

Think, that this may be *other* bug. 
Original crash (due to bad memory managment ?) isn't reproduced
Change summary. Mozilla isn't crashed on invokation of such method, 
but memory leak occurs.
Summary: Can't call method , if it has parameter of "in nsCIDRef" type → Memory leak, when try to invoke method with nsCIDRef parameter
I created bug 81122 for all memory problems
closing this on as dup


*** This bug has been marked as a duplicate of 81122 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Reopened and removed Geetha from CC
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Blocks: 81122
The current version of the xpidl compiler has the problem that it ignores the
[ref] modifier, treating parameters with [ref] as pass-by-value ones.
xpidl_header.c generates an indirect pointer (nsISupports **). We could emulate
this in java by using holder classes. So a parameter of type

[ref] (in|out|inout) nsISupports x

would be mapped to

nsISupportsHolder x

See the Java-IDL-Specification
http://java.sun.com/j2se/1.3/docs/guide/idl/mapping/jidlMapping.html for further
details.
mlk keyword needed?
Blackconnect no longer builds and hasn't been worked on since 2001.  -> WONTFIX
Status: REOPENED → RESOLVED
Closed: 23 years ago19 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: