bugGNU Octave - Bugs: bug #40423, crash after "Can't open...

 
 

bug #40423: crash after "Can't open display:" message

Submitter:  Carnë Draug <carandraug>
Submitted:  Wed 30 Oct 2013 02:26:42 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  jwe
Originator Name:  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

Fri 08 Nov 2013 01:07:43 AM UTC, comment #18: 

Works for me.

Michael Godfrey <godfrey>
Group Member
Thu 07 Nov 2013 08:12:02 PM UTC, comment #17: 

I added a changeset that checks for a DISPLAY variable and refuses to initialize the FLTK toolkit if no DISPLAY is present (http://hg.savannah.gnu.org/hgweb/octave/rev/7aadb87f599a).  If this works in Michael's environment then I think this bug can be closed.

Rik <rik5>
Group administrator
Mon 04 Nov 2013 06:34:09 PM UTC, comment #16: 

Could I just add that it might be helpful if
no graphics display is available a message
could be printed saying something like:
***No graphics DISPLAY found. Using Gnuplot printer mode.

Anyhow, it is, I think, nearly there.

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:29:51 PM UTC, comment #15: 

Well, here is another experiment:
[pbdsl3:octave] ./run-octave --no-gui --no-init-file -q
octave-gui:1> available_graphics_toolkits()
ans =
{
  [1,1] = gnuplot
}
octave-gui:2> plot(1:100)
+------------------------------------------------------------------------------------------------------------+
|                                                                                                            |
|100 ++------------------+-------------------+--------------------+-------------------+------------------++  |
|    +---------------------------------------------------------------------------------------------------++  |
|    |                                                                                            +++    ||  |
|    |                                                                                        ++++       ||  |
|    |                                                                                     +++           ||  |
|  

This has gone to gnuplot in "printer" mode.  Is this
what you expected?  If so, the remaining problem
is

graphics_toolkit('fltk')
octave-gui:3> available_graphics_toolkits()
ans =
{
  [1,1] = gnuplot
}
octave-gui:4> plot(1:100)
Can't open display:
[pbdsl3:octave]
=================
i.e. the graphics_toolkit('fltk')
does something that leads to exit();

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:22:03 PM UTC, comment #14: 

Sorry, in previous comment I had DISPLAY :0
After unsetenv DISPLAY:
[pbdsl3:octave] unsetenv DISPLAY
[pbdsl3:octave] ./run-octave --no-gui --no-init-file -q
octave-gui:1> available_graphics_toolkits()
ans =
{
  [1,1] = gnuplot
}
octave-gui:2> graphics_toolkit('fltk')
octave-gui:3> available_graphics_toolkits()
ans =
{
  [1,1] = gnuplot
}
octave-gui:4> plot(1:100)
Can't open display:
[pbdsl3:octave]

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:21:19 PM UTC, comment #13: 

What I intended to do was not allow fltk to be included in available_graphics_toolkits.  If that is done, I think you should not be able to select fltk.  But I guess I could be wrong about that too.  I'll take another look at it.

John W. Eaton <jwe>
Group administrator
Mon 04 Nov 2013 06:19:01 PM UTC, comment #12: 

[pbdsl3:octave] ./run-octave --no-gui --no-init-file -q
octave-gui:1> available_graphics_toolkits()
ans =
{
  [1,1] = fltk
  [1,2] = gnuplot
}
octave-gui:2> graphics_toolkit('fltk')
octave-gui:3> available_graphics_toolkits()
ans =
{
  [1,1] = fltk
  [1,2] = gnuplot
}
octave-gui:4>

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:16:36 PM UTC, comment #11: 

What does available_graphics_toolkits() list, both before and after attempting to set it to fltk in the sample session you have listed here?

The way I read it, the change does not prevent you from shooting yourself in the foot and switching to fltk later, it just prevents it from being set as the default. And presumably from being registered, although it may be that you can still select it even if it is not listed under available_graphics_toolkits().

Mike Miller <mtmiller>
Group Member
Mon 04 Nov 2013 05:38:15 PM UTC, comment #10: 

Basically, same here. But, I noticed:
unsetenv DISPLAY
[pbdsl3:octave] ./run-octave --no-gui --no-init-file -q
octave-gui:1> graphics_toolkit()
ans = gnuplot
octave-gui:2> graphics_toolkit('fltk')
octave-gui:3> graphics_toolkit()
ans = fltk

So, the initial switch to gnuplot worked,
but then the switch to fltk was accepted
and then the old silent exit on:
octave-gui:4> plot(1:100)
Can't open display:
[pbdsl3:octave]
================================
Is it possible that part of the fix did not make it
into the patch?

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 04:47:07 PM UTC, comment #9: 

This still does not fix it for me either. Exits octave as before.


Completely fresh build (new clone, rerun bootstrap, etc) of cset 573f865aa8c8.

Carnë Draug <carandraug>
Group Member
Mon 04 Nov 2013 04:18:59 PM UTC, comment #8: 

I just did make after hg pull; hg update
Did I need to rerun configure?

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:57:13 AM UTC, comment #7: 

Hmm, when I do that, I get gnuplot dumb terminal graphics.

John W. Eaton <jwe>
Group administrator
Mon 04 Nov 2013 06:27:26 AM UTC, comment #6: 

Did not work for me.  Fedora 19 using local
display, i.e.
printenv DISPLAY
:0

But, when I do
unsetenv DISPLAY
./run-ocatev --no-gui
I still get:
octave-gui:1> plot(1:200)
Can't open display:
[pbdsl3:octave]

Just exit, as before.

Michael Godfrey <godfrey>
Group Member
Mon 04 Nov 2013 06:12:05 AM UTC, comment #5: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/7533f4482006

John W. Eaton <jwe>
Group administrator
Sat 02 Nov 2013 08:01:48 PM UTC, comment #4: 

Not having gnuplot is already reported, see bug #35391, feel free to suggest solutions there.

There has always been an assumption that gnuplot is available, the gnuplot toolkit is always available and usable, whether or not the gnuplot executable is installed or callable.

Mike Miller <mtmiller>
Group Member
Sat 02 Nov 2013 04:52:43 PM UTC, comment #3: 

I'll be happy with anything that doesn't exit suddenly without saving the work done.

But with your change what will happen if I don't have gnuplot installed?

Carnë Draug <carandraug>
Group Member
Sat 02 Nov 2013 07:44:19 AM UTC, comment #2: 

I'm looking at fixing this by not registering the fltk graphics toolkit and also setting the default graphics toolkit to gnuplot if a graphics display is not found.

John W. Eaton <jwe>
Group administrator
Wed 30 Oct 2013 03:25:43 AM UTC, comment #1: 

Yes, it certainly seems that Octave should at least test that the OpenGL context is created correctly.

Rik <rik5>
Group administrator
Wed 30 Oct 2013 02:26:42 AM UTC, original submission:  

I have a system that does not have an X server installed (I get a warning "X11 DISPLAY environment variable not set" at Octave startup). When a function or script calls anything requiring a display, Octave crashes (exits with no chance to save the work, in some situations I even get a segmentation fault, and losing all the session history).


$ octave
warning: X11 DISPLAY environment variable not set
octave> imagesc (rand(10))
Can't open display:
$


This happens for plot, imshow, imagesc, etc.

I understand that I can't actually get anything displayed, but if a message is displayed it means it must be being caught somewhere, and could be dealt with in a way that does not lose all the work.

I have tested this with a recent Octave build (cset 7900595f1533) and graphics_toolkit set to fltk (gnuplot uses the dumb terminal).

Carnë Draug <carandraug>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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 godfrey (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by carandraug (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-07 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2013-11-07 rik5 StatusIn Progress Ready For Test
    2013-11-02 jwe StatusConfirmed In Progress
        Assigned toNone jwe
    2013-10-30 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code