bugGNU Octave - Bugs: bug #37863, Segfault with competition between...

 
 

bug #37863: Segfault with competition between core Octave readline / Java readline handler

Submitter:  None
Submitted:  Tue 04 Dec 2012 05:15:09 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Yuval Lifshitz Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 29 Aug 2013 03:52:15 PM UTC, comment #9: 

Seems to have been fixed, or at least using the test script no longer leads to a seg fault.  Closing report.

Rik <rik5>
Group administrator
Tue 20 Aug 2013 11:36:59 PM UTC, comment #8: 

Is this still a problem?  I just ran the test script which used to fail and it works now (hg id 2946888dfa56).

crash.m:

__java_init__ ();
clear all;
keyboard;



octave -qf crash.m


Rik <rik5>
Group administrator
Wed 05 Dec 2012 04:46:16 PM UTC, comment #7: 

Great work Mike.  I'm going to re-title the report to be clearer.

I've confirmed that readline is a problem.  The '--no-line-editing' option to octave allows you to forcibly disable readline.


octave --no-line-editing -qf crash.m   # works
octave -qf crash.m                     # segfaults


Rik <rik5>
Group administrator
Wed 05 Dec 2012 03:22:46 PM UTC, comment #6: 

Confirmed on the development tree, and I managed to reduce to the following script:


java_init;
clear all;
keyboard;


which must be run as an m-file script for the crash to occur:


$ octave -qf crash.m
stopped in /home/mike/crash.m at line 3
3: keyboard;
debug> panic: Segmentation fault -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault


Mike Miller <mtmiller>
Group Member
Wed 05 Dec 2012 12:53:43 AM UTC, comment #5: 

I believe the cause of the crash is the java Octave Forge package which installs its own readline event hook. I can reproduce this crash on Debian using the Debian-built packages but only if I install octave-java and have it autoloaded. And apparently only if the supplied script is run as


octave min_estimation.m


but it does not crash if I run it as


octave --eval "min_estimation"


Moreover, now that Java has been rolled into the development tree, if I add "java_init" to my ~/.octaverc, I get the same crash with a dev build of Octave with no external packages.

Attached a gdb backtrace showing that the segfault is in the readline event handler.

(file #27042)

Mike Miller <mtmiller>
Group Member
Tue 04 Dec 2012 10:56:43 PM UTC, comment #4: 

Actually, consider

https://launchpad.net/~octave/+archive/stable

which will be maintained going forward.

Mike Miller <mtmiller>
Group Member
Tue 04 Dec 2012 10:28:19 PM UTC, comment #3: 
Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Tue 04 Dec 2012 10:16:21 PM UTC, comment #2: 

installed octave-stats for that function. not sure if this is considered an external package or not.
i do get the following warning whenever i run octave:

warning: function /usr/share/octave/packages/statistics-1.1.3/fstat.m shadows a core library function

as for upgrading to 3.6.3, i'm using the version i get when i run apt-get in Ubuntu, so i'm going to wait with a manual upgrade (unless they are going to upgrade the epel repository).

Anonymous
Tue 04 Dec 2012 05:00:45 PM UTC, comment #1: 

Hard to say what is happening.  When I tried 'octave min_estimation.m' I got


error: `mvnrnd' undefined near line 35 column 27
error: called from:
error:   /home/rik/downloads/tmp/rania1/estimation_init.m at line 35, column 25
error:   /home/rik/downloads/tmp/rania1/min_estimation.m at line 37, column 161


One possibility is that you are using external packages, and it is in fact those packages, which are introducing the instability into Octave.  Another possibility is to update to Octave-3.6.3.

Rik <rik5>
Group administrator
Tue 04 Dec 2012 05:15:09 AM UTC, original submission:  

when running the project (attached zip) from outside of octave, i get a crash:

yuval@yuval-Lenovo-G580:~/dev/economics/rania1$ octave min_estimation.m
GNU Octave, version 3.6.2
Copyright (C) 2012 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type `news'.

warning: function /usr/share/octave/packages/statistics-1.1.3/fstat.m shadows a core library function
\n loading file: init_parameters.txt
\n loading files: husbands.out
\n loading files: wives.out
\n loading moments files
\n now running (test) parameters...
stopped in /home/yuval/dev/economics/rania1/estimation_f.m at line 10
10: keyboard();
debug> panic: Segmentation fault -- stopping myself...
attempting to save variables to `octave-core'...
save to `octave-core' complete
Segmentation fault (core dumped)

when running from inside, i get the debug prompt.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27042:  gdb-bt.txt added by mtmiller (16KiB - text/plain)
file #27034:  octave-core added by None (81KiB - application/octet-stream - attaching the core file)
file #27033:  rania1.tgz added by None (47KiB - application/x-compressed-tar)

 

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 jordigh (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-29 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-12-05 rik5 Summarycrash when using keyboard and calling octave &lt;file&gt; Segfault with competition between core Octave readline / Java readline handler
    2012-12-05 mtmiller CategoryNone Interpreter
        StatusNone Confirmed
        Release3.6.2 dev
    2012-12-05 mtmiller Attached File- Added gdb-bt.txt, #27042
    2012-12-04 None Attached File- Added octave-core, #27034
    2012-12-04 None Attached File- Added rania1.tgz, #27033

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code