bugGNU Octave - Bugs: bug #42432, Error with octave when using from...

 
 

bug #42432: Error with octave when using from Perl via Inline::Octave

Submitted by:  None
Submitted on:  Mon 26 May 2014 05:53:17 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: ConfirmedAssigned to: None
Originator Name: Andreas KrauseOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 21 Nov 2016 07:50:59 PM UTC, comment #6:

This issue is still present with the development code. I tested using the example in comment #3.

Rik <rik5>
Project Administrator
Fri 26 Sep 2014 04:37:01 AM UTC, comment #5:

The change occurred somewhere in the following series of changes to Octave:

http://hg.savannah.gnu.org/hgweb/octave/rev/d7392bf42fd1
http://hg.savannah.gnu.org/hgweb/octave/rev/b7ca669af528
http://hg.savannah.gnu.org/hgweb/octave/rev/b52d2f9294b6
http://hg.savannah.gnu.org/hgweb/octave/rev/2c5c538be353
http://hg.savannah.gnu.org/hgweb/octave/rev/810a71122c25
...

with some further follow-on changes.

Mike Miller <mtmiller>
Project Administrator
Fri 26 Sep 2014 01:41:25 AM UTC, comment #4:

Thanks Andy, that shows the cited error for me too. No error with 3.6.4.

If octave runs with -i (--interactive), there is no error, of course the prompt is also shown, and the result is shown correctly.

So it looks like it used to allow functions to be defined as if they were entered at the command prompt even if stdin is not an interactive terminal. In 3.8 this causes the error shown.

Mike Miller <mtmiller>
Project Administrator
Thu 25 Sep 2014 06:00:56 PM UTC, comment #3:

I think a minimalistic example for this is

Andreas Weber <andy1978>
Project Member
Thu 25 Sep 2014 04:31:06 PM UTC, comment #2:

Octave is called from Perl by spawning a new process and following communication via pipes. Therefore I can't give you an independent m-file script.

I attached a minimal Perl script to show the error. It should run with any standard Perl installation (e.g. Linux).

By changing the used octave version in line 8 you can switch between the working and non working behaviour. This is probably also the entry point to call octave with a debugger.

If you need to execute other code in octave just replace the code between the CODE marks.

Please let me know if you need any more infos.

(file #32183)

Anonymous
Wed 24 Sep 2014 11:00:21 PM UTC, comment #1:

Thanks for your bug report. I'm not sure that there's much actionable on this report without some more information from your side. What you are reporting is that an external interface to Octave doesn't work with 3.8. That may be true, and it may be something that Octave changed either intentionally or accidentally, but there's not much here that an Octave developer can start working from. I don't know that any of us know how this interface works.

Can you give more information on how Octave is being loaded or called? Is it being linked to or called via a pipe? Can you give a more minimal example that doesn't depend on Perl, with an m-file script or snippet that can be run in the interpreter that shows the same error?

Mike Miller <mtmiller>
Project Administrator
Mon 26 May 2014 05:53:17 PM UTC, original submission:

I'm currently trying to get up and running the octave interface for perl again

http://search.cpan.org/~aadler/Inline-Octave-0.31/Octave.pm

with the current octave 3.8.1. Until the previous version 3.6.4 all worked fine. The sample program

gave with 3.6.4 the correct output

jnk1= 4

When using octave 3.8.1, I get the following error:

sample.pm
Warning: function name 'myfunc' does not agree with function file name ''; (in octave code) at ./sample.pm line 0.
Undefined subroutine &main::myfunc called at ./sample.pm line 5.

Debugging, I found octave-3.8.1/libinterp/parse-tree/oct-parse.in.yy line 2819ff

with the if-condition lexer.reading_fcn_file as true -> warning. The "Undefined subroutine" error above seems like a follow-up error as id_name is overwritten with the empty variable nm.

The corresponding if-condition in octave-3.6.4/src/oct-parse.yy line 2826ff looks like

but with reading_fcn_file as false -> no warning. The reason for the different value of this flag might be an additional if-clause in octave-3.8.1/libinterp/parse-tree/lex.ll line 2411ff

which sets reading_fcn_file to true but is missing in 3.6.4. But this is too deep in the octave internals for me to be sure.

Inline::Octave starts an octave instance and communicates with it via
use IPC::Open3;
use IO::File;

So can anybody help me with this issue? An empty function file name seems to be strange.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #32183:  perl2octave added by None (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 21 Nov 2016 07:50:59 PM UTCrik5Release3.8.1=>dev
    Fri 26 Sep 2014 01:41:25 AM UTCmtmillerStatusNeed Info=>Confirmed
    Thu 25 Sep 2014 04:31:06 PM UTCNoneAttached File-=>Added perl2octave, #32183
    Wed 24 Sep 2014 11:00:21 PM UTCmtmillerStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1