bugGNU Octave - Bugs: bug #48378, native doInvoke() fails from Java...

 
 

bug #48378: native doInvoke() fails from Java method called from Octave

Submitter:  L. Stevens <carcachute>
Submitted:  Sat 02 Jul 2016 06:03:30 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Justin D. Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 03 Jul 2016 06:57:08 PM UTC, comment #2: 

Thanks for the bug report. Confirmed here on Debian on the default branch and version 3.8.2 as well.

I don't think we can call this a regression because the Java functionality was only added to Octave in version 3.8, so if it didn't work there, it just has never worked properly (and hasn't been noticed or reported properly until now).

I can confirm that it does work in the old java package on Octave 3.6, so something must have been lost when it was imported into Octave proper.

I think we need something like the following line in Octave.java


System.load (System.getProperty ("octave.java.path") + java.io.File.separator + "__java__.oct");


In addition the java package started the JVM with a -Doctave.java.path=DIR argument, so the above path could be resolved.

We'll need some similar mechanism to pass the path to liboctinterp.so into Java so the library can be loaded to resolve these native library routines.

Mike Miller <mtmiller>
Group Member
Sat 02 Jul 2016 10:30:51 PM UTC, comment #1: 

Java_org_octave_Octave_doInvoke() function exists in liboctinterp.

L. Stevens <carcachute>
Sat 02 Jul 2016 06:03:30 PM UTC, original submission:  

I have a Java class that accepts Octave function handles (OctaveReferences) for performing callbacks.  The class loads without issue but is unable to call doInvoke() to execute the callback functions.  The following error appears verbatim on the Octave console.

error: [java] java.lang.UnsatisfiedLinkError: org.octave.Octave.doInvoke(I[Ljava/lang/Object;)V

This was issue was originally noted on the help-octave list in June 2014, with Octave 3.8:
https://lists.gnu.org/archive/html/help-octave/2014-06/msg00061.html
The post suggests that Octave 3.6 does not have this issue.

The attached Java class reproduces the problem.  Call it with:

x = javaObject('foo')
x.callBack(@(x) (disp(x)) )

I have reproduced the problem using the pre-built Win32 package as well as the OS X package built using Homebrew.

I did search several different ways to see if this was submitted previously and did not find any matches.  I apologize if this is a duplicate.

L. Stevens <carcachute>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37671:  Foo.java added by carcachute (149B - application/octet-stream - Simple Java source code that replicates the problem)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by carcachute (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-03 mtmiller Item GroupRegression Incorrect Result
        StatusNone Confirmed
        Release4.0.2 dev
    2016-07-02 carcachute Attached File- Added Foo.java, #37671

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code