bugGNU Octave - Bugs: bug #40044, Octave is unresponsive after...


bug #40044: Octave is unresponsive after gnuplot crashes with segfault

Submitter:  None
Submitted:  Mon 16 Sep 2013 05:10:27 PM UTC
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open 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 08 Mar 2018 09:39:40 PM UTC, comment #6: 

The test script causes gnuplot to crash.  Octave doesn't know that's happened, so it continues on.  In _gnuplot_draw_axes_, there is a call to

  gnuplot_term = __gnuplot_get_var__ (axis_obj.parent, "GPVAL_TERM");

In _gnuplot_get_var_, Octave creates a fifo file and sends a request to gnuplot that is never answered.

I'm not sure how to detect this situation and work around it.  The development version of Octave is not responding to Ctrl-C in this case because it is stuck in a system call:

#0  0x00007ffff47134bd in open64 () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff46ab293 in __GI__IO_file_open (fp=fp@entry=0x555556c59a00, filename=<optimized out>, posix_mode=<optimized out>, prot=prot@entry=438, read_write=8, is32not64=is32not64@entry=1)
    at fileops.c:229
#2  0x00007ffff46ab433 in _IO_new_file_fopen (fp=fp@entry=0x555556c59a00, filename=filename@entry=0x7fffffff8480 "/tmp/oct-YXP99N", mode=<optimized out>, mode@entry=0x7fffffff8460 "rb",
    is32not64=is32not64@entry=1) at fileops.c:336
#3  0x00007ffff469f5b4 in __fopen_internal (filename=0x7fffffff8480 "/tmp/oct-YXP99N", mode=0x7fffffff8460 "rb", is32=1) at iofopen.c:86
#4  0x00007ffff7558725 in do_stream_open (fid=<synthetic pointer>: <optimized out>, arch="native", mode_arg="r", name="/tmp/oct-YXP99N") at /home/jwe/src/octave/libinterp/corefcn/file-io.cc:450
#5  do_stream_open (fcn=0x7ffff7901fe7 "fopen", fid=<synthetic pointer>: <optimized out>, tc_arch=..., tc_mode=..., tc_name=...) at /home/jwe/src/octave/libinterp/corefcn/file-io.cc:476

and the interrupt signal just sets a flag that the interpreter checks.  So we don't break out of the system call.

This is happening here:

stopped in:

  -->     __gnuplot_get_var__ at line 76 [/home/jwe/src/octave/scripts/plot/util/private/__gnuplot_get_var__.m]
        __gnuplot_draw_axes__ at line 38 [/home/jwe/src/octave/scripts/plot/util/private/__gnuplot_draw_axes__.m]
      __gnuplot_draw_figure__ at line 164 [/home/jwe/src/octave/scripts/plot/util/private/__gnuplot_draw_figure__.m]
          __gnuplot_drawnow__ at line 86 [/home/jwe/src/octave/scripts/plot/util/__gnuplot_drawnow__.m]
                        surfc at line 89 [/home/jwe/src/octave/scripts/plot/draw/surfc.m]
                          foo at line 19 [/net/buserror/scratch/jwe/build/octave/foo.m]

Since the test code would probably work if gnuplot didn't fail, and because both the fltk and qt plotting widgets work with this code, I'm lowering the priority to normal.

John W. Eaton <jwe>
Group administrator
Mon 08 Aug 2016 03:10:48 AM UTC, comment #5: 

With dev and gnuplot 5.0.3 i see no plot window and get:

           line 0: out of memory for pm3d_plot->quadrangles

           line 0: out of memory for pm3d_plot->quadrangles

* Error in `/usr/bin/gnuplot': double free or corruption (out): 0x0000561967f31de0 *
======= Backtrace: =========
======= Memory map: ========
561965fdd000-561966148000 r-xp 00000000 08:02 1442514                    /usr/bin/gnuplot-qt

With octave 4.0.3 I get
           line 0: out of memory for pm3d_plot->quadrangles

           line 0: out of memory for pm3d_plot->quadrangles
and no memory dump and I see a gnuplot window with
5 plots (partially rendered).

on a screen

Dmitri A. Sergatskov <dasergatskov>
Mon 08 Aug 2016 01:26:08 AM UTC, comment #4: 

Confirmed that bug is still present with gnuplot 5.0.1 and the development branch from 8/7/16.

Rik <rik5>
Group administrator
Mon 02 Feb 2015 04:46:42 AM UTC, comment #3: 

Confirmed that the bug is still present with gnuplot version 4.6.6 and a development branch from 2/1/2015.

Rik <rik5>
Group administrator
Mon 16 Sep 2013 06:53:44 PM UTC, comment #2: 

It's probably a bug in gnuplot, but I can't confirm 100%.  In testing with Octave versions 3.2.4, 3.4.3, 3.6.4, and development versions I can always reliably produce a crash.  My version of gnuplot is 4.6.2.

Interestingly, If I vary the final plot I don't get a crash.  I tried a 2-D plot [plot (1:10)], and the other 3-D plots that didn't use plot3 (mesh, surf, surfc).

Also, if I throw a line


after the first subplot, just to create the axes, then everything works.

Rik <rik5>
Group administrator
Mon 16 Sep 2013 05:39:08 PM UTC, comment #1: 

I can confirm this. At first blush, this might be a bug in gnuplot, not in Octave. As a workaround, you can try using Octave's own native plotting system. Before doing any plot commands, do

graphics_toolkigt fltk

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 16 Sep 2013 05:10:27 PM UTC, original submission:  

I am trying to plot 8 graphs in one plot with Ubuntu 12.04.3 LTS but I allways get the error:
* glibc detected * gnuplot: double free or corruption (fasttop): 0x08d72878 *
======= Backtrace: =========
======= Memory map: ========
(full message: see file below)
It also occured in other versions (I've tried 3.2.? (ubuntu standard and 3.4.?)

A minimal example is given below (try.m); if I remove one or more of the subplots, the error doesn't occur anymore

I hope, this is all information required.
Best regards,



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

Attach Files:

Attached Files
file #29150:  error.dat added by None (14KiB - application/x-ns-proxy-autoconfig)
file #29151:  try.m added by None (395B - text/x-objcsrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jordigh (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-08 jwe Severity4 - Important 3 - Normal
        Summary* glibc detected * gnuplot: double free or corruption (fasttop): 0x08d72878 * Octave is unresponsive after gnuplot crashes with segfault
    2016-07-01 rik5 Severity3 - Normal 4 - Important
    2013-10-27 mtmiller CategoryPlotting Plotting with gnuplot
        Release3.6.3 dev
    2013-09-16 jordigh StatusNone Confirmed
    2013-09-16 None Attached File- Added error.dat, #29150
        Attached File- Added try.m, #29151

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code