bugGNU Octave - Bugs: bug #45863, Octave crashes when clicking on...

 
 

bug #45863: Octave crashes when clicking on polar plot using OpenGL

Submitted by:  None
Submitted on:  Wed 02 Sep 2015 12:41:17 PM UTC  
 
Category:  Plotting with OpenGL Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Need Info Assigned to:  None
Originator Name:  Anthony J Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.0.0
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)

Mon 22 Aug 2016 07:48:13 AM UTC, comment #33: 

Hi,

sorry to reply so late. Just as final note.
Version 4.0.3 fixed the problem for me. No more crashes.

Thanks !

Sunny Wong <sunny_wong>
Mon 08 Aug 2016 08:36:47 PM UTC, comment #32: 

I'm going to close this report.  The crash was real, but the possible causes were vague and they may have already been fixed in the upcoming 4.2 release.

After 4.2 is out any strange crashes can be reported against that version as new bugs.

Rik <rik5>
Project Administrator
Mon 11 Jul 2016 12:56:53 PM UTC, comment #31: 

Sunny, are you able to apply the patch file #37622 and see if that prevents the crash?

Even if not, could you show the output (if any) sent to the console when there is a crash?

Thanks

Lachlan Andrew <lachlan>
Wed 29 Jun 2016 10:34:20 PM UTC, comment #30: 

In comment #29 Lachlan asked about original submission.
Originally this was about a seg fault due to clicking on a
qt plot. So, the bug title was appropriate.

Michael Godfrey <godfrey>
Project Member
Wed 29 Jun 2016 09:52:16 PM UTC, comment #29: 

Thanks for checking Sunny, but I don't think that was what I was asking for.

I was asking for someone to apply the patch at bug #46501, recompile and then test.  The patch won't have made it into any repository yet.  Are you able to apply the patch and re-test?

Michael, I realise that comment #19 was saying that the problem had gone.  My question was whether or not the problem was originally a seg fault.  You probably don't remember and can no longer check, so that is OK.

Lachlan Andrew <lachlan>
Wed 29 Jun 2016 02:55:52 PM UTC, comment #28: 

Lachlan: In comment #26 you asked about seg faults... That
comment was meant to report that clicking on a figure no longer
caused any problem. Definitely no seg faults.

Michael Godfrey <godfrey>
Project Member
Wed 29 Jun 2016 01:39:46 PM UTC, comment #27: 

Hi,
using octave 4.0.2 from the arch repository it still crashes.

I posted the output from my systemctl. Is this what you were asking for?

http://pastebin.com/g4ZNrTx5

Sunny Wong <sunny_wong>
Wed 29 Jun 2016 01:16:04 PM UTC, comment #26: 

This may be helped by the patch for bug #46501.  That may prevent the crashes -- although it won't stop the initial error.

(Michael, you mentioned seg faults in comment #19.  Were they definitely seg faults rather than uncaught exceptions?)

Lachlan Andrew <lachlan>
Mon 02 Nov 2015 11:42:08 AM UTC, comment #25: 

@Sunny: Unfortunately there has been no change on Octave side that could change the selection mechanism behavior. The only reason I can think of to understand why Michael doesn't see the segfault anymore is that MESA (or related libraries) has been updated on his system.

Is the new version that you tested a system update? Did you build the tarball yourself? In the latter case you could try to apply manually the cset I proposed in comment #17. It is very simple so you can copy/paste the modifications in /libgui/graphics/gl-select.h, save and then try to "make" again. Then try clicking on a patch (other primitives are not supposed to be affected by this mod) and see what happens.

Pantxo Diribarne <pantxo>
Project Member
Mon 02 Nov 2015 08:26:53 AM UTC, comment #24: 

Hi,

installed the recent update : octave-4.0.0-6-x86_64
Unfortunately the bug still exists.

Mesa 11.0.4 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 11.0.4 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa

Sunny Wong <sunny_wong>
Fri 23 Oct 2015 06:32:14 AM UTC, comment #23: 

sorry. I do not have a stable build on my system.
And, I am leaving for the plane.

The report that I found was, I think, the only
"private" patch that I applied.

Again, sorry for any confusion.

Michael Godfrey <godfrey>
Project Member
Fri 23 Oct 2015 05:55:27 AM UTC, comment #22: 

@Michael: well I should have added "on stale". The changeset you mention is on default and was meant to fix a bug on default introduced by its author :-). So this one can't have solved the issue here which is present on stable.  

Pantxo Diribarne <pantxo>
Project Member
Thu 22 Oct 2015 04:32:40 PM UTC, comment #21: 

I have a plane to catch, so just quickly:

I think that this did some or all of the good:
# HG changeset patch
# User Pantxo Diribarne <pantxo.diribarne@gmail.com>
# Date 1441646909 -7200
#      Mon Sep 07 19:28:29 2015 +0200
# Node ID 7b47a5904ac5ef814cbd69d3f663a72c0a67c17d
# Parent  7d8ec197b08bd558f19ebbc24ca66e23c3c02e22
Fix segfault when hovering a Qt figure while it being drawn (bug #45540)

And, cannot find any others that look relevant.
Sorry that I do not have more time.

Michael Godfrey <godfrey>
Project Member
Thu 22 Oct 2015 01:34:26 PM UTC, comment #20: 

@Michael: I know it is a fastidious task but would you have time to search what revision fixed the issue?

Pantxo Diribarne <pantxo>
Project Member
Thu 22 Oct 2015 01:29:50 PM UTC, comment #19: 

Using Fedora 22 and Intel HD5000/6000 I no longer see seg
faults on either the clicking while painting, polar plot
or other moving,etc., of figures.

Is is using current dev.

Michael Godfrey <godfrey>
Project Member
Thu 22 Oct 2015 11:36:46 AM UTC, comment #18: 

@Michael: Do I understand that this bug is no more an issue from your email on the maintainers list[1]? If you are still seeing the crash when clicking on a polar plot, can you test the patch I attached in comment #17?

[1] http://octave.1599824.n4.nabble.com/error-doesn-t-return-to-debug-prompt-tc4672950.html

Pantxo Diribarne <pantxo>
Project Member
Mon 19 Oct 2015 05:52:52 PM UTC, comment #17: 

I attached a patch that is meant to be applied on stable for testing. It's a long shot: I added a "glFinish ()" after patch drawing operations to ensure all patches have been drawn and rasterized before searching for names in the select buffer.

(file #35230)

Pantxo Diribarne <pantxo>
Project Member
Mon 19 Oct 2015 12:23:24 PM UTC, comment #16: 

@Sunny: Thanks, so the segfault happens whatever the object that is clicked, but patches (more complex/time consuming drawing in OpenGL) are more likely to trigger it at first click.

Maybe adding a few "GLfinish ()" at the of the rendering methods in gl-select could do the job. I'll try to provide a patch in that direction for test.

Pantxo Diribarne <pantxo>
Project Member
Mon 19 Oct 2015 12:00:07 PM UTC, comment #15: 

In my opinion, it doesn't matter which type of plot someone uses.

I tried every example in this thread (resulting in a crash) :
For your example

clf ();
axes ("color", "none")
## Multiple clicks inside the axes

Everything is fine. No crashs after dragging and multiple clicks (>30)

clf ();
axes ("color", "none")
## Multiple clicks inside the axes
## Multiple clicks on the axes lines
set (gca (),"color", "r")
## Multiple clicks on the red area

Immediately crashes already after one click (tried multiple times .. always crash after one click)

clf ();
axes ("color", "none")
## Multiple clicks inside the axes
## Multiple clicks on the axes lines
set (gca (),"color", "r")
## Multiple clicks on the red area
patch ()
## Multiple clicks on the black area

Immediately crashes already after one click (tried multiple times .. always crash after one click)

clf ();
axes ("color", "none")
## Multiple clicks inside the axes
## Multiple clicks on the axes lines
set (gca (),"color", "r")
## Multiple clicks on the red area
patch ()
## Multiple clicks on the black area
cla ()
image ()
## Multiple clicks on the image ...

Either it crashes after 18-20 clicks, or on click 19-20 the following message appears inside octave editor (then one more click results in a crash)

Mesa 11.0.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 11.0.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa

I will also add an image which displays one of the last tries.


Sunny Wong <sunny_wong>
Mon 19 Oct 2015 11:36:24 AM UTC, comment #14: 

As I can't reproduce this bug it is hard to find what exactly is the triggering it.

@Sunny: Do you even need a polar axes (the background is a patch) or markers to trigger the bug? Does clicking on the background of simple axes or a patch, image ..., objects trigger the bug?

clf ();
axes ("color", "none")
## Multiple clicks inside the axes
## Multiple clicks on the axes lines
set (gca (),"color", "r")
## Multiple clicks on the red area
patch ()
## Multiple clicks on the black area
cla ()
image ()
## Multiple clicks on the image ...

Pantxo Diribarne <pantxo>
Project Member
Mon 19 Oct 2015 07:42:40 AM UTC, comment #13: 

Hi,

I wanted to add, that with the current version, the message still occurs.

Mesa 11.0.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 11.0.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa

One more click after this message results in a octave crash, so it might be related.

using GNU Octave, version 4.0.0

Sunny Wong <sunny_wong>
Fri 09 Oct 2015 07:12:10 AM UTC, comment #12: 

Hi,

i tried the example

plot(1:10, 'o-')

after clicking 20 times on a dot, i got this message in the terminal

Mesa 10.6.7 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 10.6.7 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa

Might be helpful.

My specs are seen in comment #8

Best Wishes
- Sunny

Sunny Wong <sunny_wong>
Fri 02 Oct 2015 10:48:58 PM UTC, comment #11: 

Can I help in a more deeper way. Perhaps using the software in debug mode and posting some useful debug information.

Anthony J. <stargazer2012>
Fri 02 Oct 2015 06:46:05 PM UTC, comment #10: 

@Anthony: Thanks for testing.  I don't have a way to debug this since I can't reproduce this.  Clearly now that Octave is using OpenGL heavily there are more random crashes as the combined number of video card hardware and OpenGL library versions combinations has increased.

Rik <rik5>
Project Administrator
Fri 02 Oct 2015 04:49:08 PM UTC, comment #9: 

@Rik

Sorry it's taking long to get back to this. My line of work can be like that. I will try to get back to you in a timelier manner.

So if I plot "plot (1:10, 'o-')", it does not crash if I click within it, but if I click on pan, and move the plot around a bit, then after a couple of seconds, it does completely crash...

Anthony J. <stargazer2012>
Tue 22 Sep 2015 01:11:28 PM UTC, comment #8: 

Hi,

I think, I got the same problem.

I ran the inital polar example and clicking in the plot results in a crash "octave exited with signal 11"

Also this example results in a crash of octave (when clicking in the plot):

w = -6 + sqrt(10) * (randn(1,10000));
# plot histogram
hist(w, 50);

It might be related:
I also can't save images.
The following script results in an immediate crash

t = [0:0.01:0.98];
y1 = sin(2*pi*4*t);

plot(t,y1);
print -dpng 'myplot.png';

Using:
- Arch Linux x64 (extra/octave 4.0.0-3 [installed])
- Octave 4.0.0
- Intel Graphics HD 5500 hardware
- extra/mesa-libgl 10.6.7-1 [installed]
- extra/mesa 10.6.7-1 [installed]

Anonymous
Tue 22 Sep 2015 11:06:50 AM UTC, comment #7: 

I should just add that the crash on clicking on
figure as it is being drawn (item 3. below) seems to be qt specific.
i.e. it does not happen with fltk.

Michael Godfrey <godfrey>
Project Member
Tue 22 Sep 2015 10:59:54 AM UTC, comment #6: 

For me, this (or a similar) problem only
occurs with qt. And, it typically requires
a number of mouse actions (click on plot, move, resize)
before the seg fault occurs.

This may be connected with the problem reported
in bug #45540. I think that Pantxo is working on this
and may decide to open a new bug report since there
has been some confusion over problems with OpenGL. There
seem to be several problems:

1. Use of gt or fltk. Most problems are specific to one
   or the other.
2. Just hovering over plot causes seg fault.
3. Clicking on plot while it is still being drawn.
4. Several clicks or other actions after plot has been
   drawn using qt.

By the way, when I just tried the case 3 above with qt
I got:

>> graphics_toolkit('qt')
>> plot(1:20000)
>> Mesa 10.6.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 10.6.3 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
panic: Segmentation fault -- stopping myself...

The crash happened before, but did not produce this error
message from Mesa.

Michael Godfrey <godfrey>
Project Member
Mon 21 Sep 2015 09:05:16 PM UTC, comment #5: 

Re-titling to reflect apparent issue.

Does it work with any 2-D plot, or is it only plots with surface objects?  For example, does the following plot work

plot (1:10, 'o-')
# Click inside created plot

Rik <rik5>
Project Administrator
Mon 21 Sep 2015 12:47:04 AM UTC, comment #4: 

Hi, this is the person who submitted this bug report.

The crash is not specific to my polar plot. If you run for example, the program sombrero(20) with OpenGL used, then the same thing occurs.

Anonymous
Fri 11 Sep 2015 11:45:05 AM UTC, comment #3: 

OP: is this crash specific to your polar plot example, or does Octave crash when clicking on any plot figure?

Mike Miller <mtmiller>
Project Administrator
Wed 02 Sep 2015 07:21:14 PM UTC, comment #2: 

Bug #45540 was reported against the development branch and this is reported against stable.  Are they really the same bug?

Rik <rik5>
Project Administrator
Wed 02 Sep 2015 03:44:33 PM UTC, comment #1: 

Duplicate of 45540.
Please refer to that report.
This one should be closed.

Michael Godfrey <godfrey>
Project Member
Wed 02 Sep 2015 12:41:17 PM UTC, original submission:  

Here's the content of my polarp.m file. Simple enough.

theta = 0:0.01:2*pi;
rho = (sin(3*theta)).^2;
polar(theta,rho);

Octave plots the graph using "OpenGl", but if I click on the drawn graph, then all of Octave crashes.

Also, if I choose instead to use "gnuplot", then NO graph shows up in the plot window. But, it does plot o.k in "fltk", but I would rather the opengl toolkit (If I can call it that), if only because it looks better and has some better interface features.

I tried playing around with various "Advance" features of KDE in Desktop Effects in System Settings; compositing type, qt graphics system, etc. But the same outcome. I ran Octave in Openbox as well, instead of KDE; again same outcome.

FYI, my system is PCLinuxOS 2014.12 64 bit KDE Platform V 4.14.10, running on an ASUS laptop (i5, 8 GB, Intel Graphics HD 5500 ), linux kernel 4.1.3-pclos1, 3.0 Mesa 10.6.5.

Attached is the various scenarios with each toolkit, the opengl one is however, a small ogv video (880 Kb).

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35230:  finish.patch added by pantxo (843B - application/x-download)
file #35228:  octaveBug.png added by sunny_wong (73KiB - image/png)
file #34791:  fltk.png added by None (47KiB - image/png - These files shows the various scenarios.)
file #34792:  OpenGL.ogv added by None (859KiB - video/ogg - These files shows the various scenarios.)
file #34793:  gnuplot.png added by None (42KiB - image/png - These files shows the various scenarios.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by sunny_wong (Posted a comment)
  • -email is unavailable- added by stargazer2012 (Posted a comment)
  • -email is unavailable- added by pantxo
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-08 rik5 Open/ClosedOpen => Closed
    2016-07-01 rik5 Severity3 - Normal => 4 - Important
    2015-10-19 pantxo Attached File- => Added finish.patch, #35230
    2015-10-19 sunny_wong Attached File- => Added octaveBug.png, #35228
    2015-09-22 pantxo Carbon-Copy- => Added pantxo.diribarne@gmail.com
    2015-09-21 rik5 SummaryOctave crashes when I try to plot a polar plot using OpenGL => Octave crashes when clicking on polar plot using OpenGL
    2015-09-11 mtmiller StatusNone => Need Info
    2015-09-04 rik5 Carbon-CopyRemoved 72865 => -
    2015-09-02 None Attached File- => Added fltk.png, #34791
        Attached File- => Added OpenGL.ogv, #34792
        Attached File- => Added gnuplot.png, #34793

    Back to the top


    Powered by Savane 3.5