Incorrect Java methods called from CNI

Bryce McKinlay mckinlay@redhat.com
Mon May 10 20:58:00 GMT 2004


Dave Menendez wrote:

>I posted a message saying that it appeared I was mistaken and that the
>correct method was indeed being called.  Upon even closer observation,
>however, I'm sure that my original observation was correct and that the
>incorrect method is being called.  Sorry for the flip flop.
>  
>

First, are you sure that the CNI .h file you generated for the class you 
are calling is consistent with the implementation? If you added a method 
to the class (or its superclass) and forgot to regenerate the .h files, 
you'll encounter this problem.

>I'm not sure what I can provide to help someone track this down short of
>the actual library source, but it could be quite awhile before I'd be
>able to come up with a small set of code that duplicates the problem,
>since I have no idea what might be causing it.  If you have any ideas in
>the meantime, I'd be happy to provide what I can.
>  
>

You can run "gcc -S"/"gcj -S" to get a dump of the asm being generated 
for the caller method, and the vtable of the callee. Specifically, there 
should be a symbol starting with "_ZTVN" in the class being called which 
contains the vtable layout.

Regards

Bryce



More information about the Java mailing list