bugGNU Octave - Bugs: bug #45604, Windows XP Octave 4.0.0 plot...


bug #45604: Windows XP Octave 4.0.0 plot crashes

Submitter:  Kevin Berger <khb>
Submitted:  Wed 22 Jul 2015 07:50:22 PM UTC
Category:  Plotting Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Need Info Assigned to:  None
Originator Name:  KHB Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Mon 11 Jul 2016 05:13:31 AM UTC, comment #13: 

No response.  Closing report.

Rik <rik5>
Project Administrator
Fri 01 Jul 2016 10:10:39 AM UTC, comment #12: 

Is the issue present on 4.0.2?

Tatsuro MATSUOKA <tmacchant>
Tue 28 Jul 2015 07:00:25 AM UTC, comment #11: 

For the moment, there isn't much you can do.  I think it would be best to wait until the select code has been reworked slightly:


and then retry this example (clicking on the column of data points).  End of August would be my guess.

Dan Sebald <sebald>
Mon 27 Jul 2015 08:45:46 PM UTC, comment #10: 

So as a user (not programmer), do I need to do anything more to help with this or wait for bug fix?

Kevin Berger <khb>
Sun 26 Jul 2015 09:51:38 AM UTC, comment #9: 

@Dan: there is nothing indicating that this bug has something to do with bug #45540: no need for mouse interaction plus it is triggered for all three graphics_toolkits.

I guess it is an XP specific bug like those we have already seen elsewhere (see e.g. bug #44292).

Pantxo Diribarne <pantxo>
Project Member
Sat 25 Jul 2015 05:03:49 PM UTC, comment #8: 

There is a patch posted here:


for this bug report:


that slightly changes the behavior.  No longer does hovering over the dense set of points produce the warning:

warning: opengl_selector::select: selection buffer overflow

That warning now only appears when I position the cursor above the pixels where the dense data is and select using the left mouse button.  So, with the patch there is a good chance that Windows qt plot will not crash right away, or with hovering the cursor over the plot/data.  But could you try hovering the cursor over the data shown on the plot and then press the left mouse button to select?  There's a chance in that case a crash could still occur.

Dan Sebald <sebald>
Fri 24 Jul 2015 05:27:20 AM UTC, comment #7: 

I think I know what that warning message is, and honestly I think it may be undo alarm.  This warning

warning: opengl_selector::select: selection buffer overflow

comes from gl-select.cc in the function

opengl_selector::select (const graphics_object& ax, int x, int y, int flags)

which does

  glRenderMode (GL_SELECT);
  glInitNames ();

  object_map.clear ();

  draw (ax);

  int hits = glRenderMode (GL_RENDER);

After the above code is a conditional and if 'hits' is negative then the warning message is issued.  It's a bit tricky, the 'hits' applies not to GL_RENDER mode, but the previous mode when glRenderMode is called, GL_SELECT.  So hits indicates the number of items selected, I think, or something related to it.  There is an explanation here:


With the plot so dense with points/curves (1000 of them), every pixel where the data is probably represents dozens of objects that are selected and moving the mouse across a few pixels could quickly generate a couple hundred hits.  Hence, the buffer indicating selections is probably overflowing and isn't large enough to contain all the objects.

Well, that is a problem in the sense of buffer overflow and not knowing exactly how to handle that situation.  But it is kind of an innocuous problem too--the solution being to increase the buffer size somehow, but how big?  (It is now at 128.)  Any choice seems it can overflow with the right Octave plot command.  One could

1) Increase buffer size dynamically (double size) if the 'hits' value comes back negative.  Do not issue warning message.

2) Do not issue the warning message, just do nothing if the buffer overflows.

3) Leave the warning message as is.  (But few if any will know what it means.)

Should I move this to another bug thread?

Dan Sebald <sebald>
Fri 24 Jul 2015 04:40:48 AM UTC, comment #6: 

OK, then this likely is not an opengl/Qt issue.  So, I'm going to bounce the problem with

warning: opengl_selector::select: selection buffer overflow

over to bug https://savannah.gnu.org/bugs/?45540 under the assumption that it is a separate issue.

The crash problem might be a segmentation fault with assigning memory hunks for the large number of curves in the plot.

You could maybe try a few things that might give some insight to what is wrong.  For example, you could starting with a low number of curves, say


and increase/decrease the number to see if/when a failure occurs.

You might try looking at the properties of the plot/axes to see if there are any clues, e.g.,

kids = get(gca, 'Children');

Probably won't lead to much but any clue helps.  I'm just surprised how long even 100 curves takes to plot.

Dan Sebald <sebald>
Fri 24 Jul 2015 12:25:28 AM UTC, comment #5: 

Yes, it occurred (closed out plot and Octave) with all three graphics packages:
graphics_toolkit gnuplot
graphics_toolkit fltk
graphics_toolkit qt

Kevin Berger <khb>
Thu 23 Jul 2015 07:11:45 PM UTC, comment #4: 

Well, I'm not so sure what the issue without digging into things deeper.  (I'm reluctant to look into the Qt terminal because last I saw it uses the callback strategy, which I view as a structural issue.  Also, to really pinpoint driver issues means compiling a lot of local utilities, which I've done for another problem, but it's a lot of work.)

If the person reporting the bug could verify it is all of the graphics toolkits failing that would help narrow things.  Otherwise, if it is only Qt, it might be that this bug and https://savannah.gnu.org/bugs/?45540 are the same.

One comment on the slowness of the drawing.  I think the reason this is so slow is that the construct,


creates one thousand individual curves (all consisting of a single data point) on the plot.  Each of those curves is an object so it must have a set of properties created and initialized.  Perhaps that is the slow part.  Maybe that code should be optimized internally.

Dan Sebald <sebald>
Thu 23 Jul 2015 08:15:13 AM UTC, comment #3: 

@Dan: The original bug report is against 4.0 on Windows XP. AFAICT the issue you describe is most probably related bug #45540 that only happens in dev, for Qt toolkit only. Can you comment there please? It may be a clue.

Pantxo Diribarne <pantxo>
Project Member
Wed 22 Jul 2015 09:53:55 PM UTC, comment #2: 

Something certainly doesn't seem correct.  For Qt, on linux, outside of not crashing the behavior is very similar.  There is a long delay and then a plot appears which has presumably 1000 curves at the location x=1000 sequencing though the various colors.  When the mouse cursor is positioned over one of the data "points"/"curves" the following warning message appears:

warning: opengl_selector::select: selection buffer overflow

With the FLTK toolkit I see a long delay but no such warning as for the Qt toolkit.  And once the data is in the window on the screen, scaling/redrawing is very quick.

I generated an intermediate gnuplot ASCII file using "drawnow()" and that loads into gnuplot very quickly.

So either Octave is doing something slow, or the data transfer is slow.  But seeing as Qt takes a long time as well, Octave is doing something slow when it comes to generating 1000 individual curves.  But the slowness and crash may be unrelated.

I don't understand your second comment.  Did you mean gnuplot/fltk crash also?  Be sure to make sure the graphics toolkit is active in the window by doing:


because otherwise graphics_toolkit() doesn't necessarily change the property of the existing window, which would remain as Qt.

Dan Sebald <sebald>
Wed 22 Jul 2015 08:27:27 PM UTC, comment #1: 

graphics_toolkit gnuplot
graphics_toolkit fltk

Also, close the emplty plot and Octave.

Kevin Berger <khb>
Wed 22 Jul 2015 07:50:22 PM UTC, original submission:  

Just installed 4.0.0 on Windows XP.
ans = qt


Figure 1 opens, nothing is displayed, 3-4 seconds later Figure 1 and Octave close.

Kevin Berger <khb>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by tmacchant (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by khb (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 project members can vote.





    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-11 rik5 Open/ClosedOpen Closed
    2016-07-02 rik5 StatusNone Need Info
    2016-07-01 rik5 Severity3 - Normal 4 - Important

    Back to the top

    Powered by Savane 3.9