Re: [Plplot-devel] [ plplot-Bugs-2998260 ] -dev xwin shows fatal error when window closed

2010-05-11 Thread Andrew Ross
On Mon, May 10, 2010 at 08:49:46PM -0500, Maurice LeBrun wrote:
 On Monday, May 10, 2010 at 09:50:28 (-0700) Alan W. Irwin writes:
   On 2010-05-10 13:55+0100 Andrew Ross wrote:
   
On Fri, May 07, 2010 at 09:03:59PM -0400, chm wrote:
On 5/7/2010 1:03 PM, SourceForge.net wrote:
Summary: -dev xwin shows fatal error when window closed
   
Initial Comment:
For -dev xwin, when you close the window by alt+F4 or other 
 equivalents, the following fatal error message is the result:
   
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server
   
This fatal error can be disruptive to certain environments (e.g., 
 lisp)  and should be replaced by a smooth exit from PLplot. as occurs under 
 these same circumstances for -dev qtwidget and -dev wxwidgets.
   
   
   
I took a look at xwin.c and it appears that a number of the X11
calls do not have check for error returns.  Perhaps this is the
origin of the problem.
   
The underlying problem is that to detect pressing of the close button in
the top right of a X window you need to explicitly ask for it to be
forwarded on, and then handle the consequences yourself. I've now
committed a change to do this. The event handling in the xwin driver is
not simple and so I would appreciate people robustly testing these
changes to make sure I've not broken anything else.
   
   Thanks very much for taking on this tricky fix.
   
   I tried a lot of variations of x01c with -xor and -locate with various ways
   of closing the window and all was well.  I also tried multipage examples 
 and
   all seemed well.  Finally, I tried -dev tk (which depends on -dev xwin
   code) using the command
   
   examples/c/x01c -dev tk
   
   and I get a hang from alt+F4 or any other method of closing the window.
   (BTW, to set up all the prerequisites for that command you can
   use make -j4 test_c_tk or make -j4 all.)
   
   I am not sure whether this -dev tk hang is a long-standing problem or the
   result of your recent change because up to now I have rarely tested closing
   the window, but it would be great if you would be willing to take a look.
 
 I'm not sure about the tk driver status, as it's been a long time since I used
 it substantially.  But I do use the plframe binding, a lot.  And I fear the
 bug fix as implemented will be incompatible with that.  Here's the situation:
 a user with a plplot-enhanced wish (the one we build in the package is named
 plserver) launches a bunch of windows.  Then the user clicks on the go-away
 button.  The xwin driver calls plexit() and the whole application shuts down.
 Not good.  It should just exit that stream.
 
 I haven't verified this experimentally, but an easy way to do so is using
 examples/tk/tk03.  It uses a stock plserver for plotting (you can change
 @plserver_LOCATION@ to be just . and run from the directory plserver is
 sitting in).  Click on the Open new button to open a 2nd plframe.  Then
 close it with the goaway button.  Only that window, and not the first, should
 shut down.

This is something of a tricky issue. Personally I don't like calling plexit -
it seems like an overkill, particularly for interactive use like plframe
or the octave bindings. This is what other drivers (e.g. qtwidget) do 
though. Actually this is a more general issue where you don't want plexit to
be terminal to the whole program. I find this really irritating with octave
for example where you do a whole load of calculations, then an error in plplot
causes octave to crash and you have to repeat the whole thing.

A way round this is to call plsexit with a replacement exit handler. Perhaps
we should implement this for plframe and octave? An alternative would be 
some flag that bindings could set to say Don't make calls to plexit terminal?

Of course this still leaves tricky questions about neatly tidying up the 
plplot stream. This is something that plplot isn't very good at. 

Andrew

--

___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] [ plplot-Bugs-2998260 ] -dev xwin shows fatal error when window closed

2010-05-10 Thread Andrew Ross
On Fri, May 07, 2010 at 09:03:59PM -0400, chm wrote:
 On 5/7/2010 1:03 PM, SourceForge.net wrote:
  Summary: -dev xwin shows fatal error when window closed
 
  Initial Comment:
  For -dev xwin, when you close the window by alt+F4 or other equivalents, 
  the following fatal error message is the result:
 
  XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server
 
  This fatal error can be disruptive to certain environments (e.g., lisp)  
  and should be replaced by a smooth exit from PLplot. as occurs under these 
  same circumstances for -dev qtwidget and -dev wxwidgets.
 
 
 
 I took a look at xwin.c and it appears that a number of the X11
 calls do not have check for error returns.  Perhaps this is the
 origin of the problem.

The underlying problem is that to detect pressing of the close button in 
the top right of a X window you need to explicitly ask for it to be 
forwarded on, and then handle the consequences yourself. I've now 
committed a change to do this. The event handling in the xwin driver is 
not simple and so I would appreciate people robustly testing these 
changes to make sure I've not broken anything else.

Andrew

--

___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] [ plplot-Bugs-2998260 ] -dev xwin shows fatal error when window closed

2010-05-10 Thread Alan W. Irwin
On 2010-05-10 13:55+0100 Andrew Ross wrote:

 On Fri, May 07, 2010 at 09:03:59PM -0400, chm wrote:
 On 5/7/2010 1:03 PM, SourceForge.net wrote:
 Summary: -dev xwin shows fatal error when window closed

 Initial Comment:
 For -dev xwin, when you close the window by alt+F4 or other equivalents, 
 the following fatal error message is the result:

 XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server

 This fatal error can be disruptive to certain environments (e.g., lisp)  
 and should be replaced by a smooth exit from PLplot. as occurs under these 
 same circumstances for -dev qtwidget and -dev wxwidgets.



 I took a look at xwin.c and it appears that a number of the X11
 calls do not have check for error returns.  Perhaps this is the
 origin of the problem.

 The underlying problem is that to detect pressing of the close button in
 the top right of a X window you need to explicitly ask for it to be
 forwarded on, and then handle the consequences yourself. I've now
 committed a change to do this. The event handling in the xwin driver is
 not simple and so I would appreciate people robustly testing these
 changes to make sure I've not broken anything else.

Thanks very much for taking on this tricky fix.

I tried a lot of variations of x01c with -xor and -locate with various ways
of closing the window and all was well.  I also tried multipage examples and
all seemed well.  Finally, I tried -dev tk (which depends on -dev xwin
code) using the command

examples/c/x01c -dev tk

and I get a hang from alt+F4 or any other method of closing the window.
(BTW, to set up all the prerequisites for that command you can
use make -j4 test_c_tk or make -j4 all.)

I am not sure whether this -dev tk hang is a long-standing problem or the
result of your recent change because up to now I have rarely tested closing
the window, but it would be great if you would be willing to take a look.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__

--

___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] [ plplot-Bugs-2998260 ] -dev xwin shows fatal error when window closed

2010-05-10 Thread Maurice LeBrun
On Monday, May 10, 2010 at 09:50:28 (-0700) Alan W. Irwin writes:
  On 2010-05-10 13:55+0100 Andrew Ross wrote:
  
   On Fri, May 07, 2010 at 09:03:59PM -0400, chm wrote:
   On 5/7/2010 1:03 PM, SourceForge.net wrote:
   Summary: -dev xwin shows fatal error when window closed
  
   Initial Comment:
   For -dev xwin, when you close the window by alt+F4 or other equivalents, 
   the following fatal error message is the result:
  
   XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server
  
   This fatal error can be disruptive to certain environments (e.g., lisp)  
   and should be replaced by a smooth exit from PLplot. as occurs under 
   these same circumstances for -dev qtwidget and -dev wxwidgets.
  
  
  
   I took a look at xwin.c and it appears that a number of the X11
   calls do not have check for error returns.  Perhaps this is the
   origin of the problem.
  
   The underlying problem is that to detect pressing of the close button in
   the top right of a X window you need to explicitly ask for it to be
   forwarded on, and then handle the consequences yourself. I've now
   committed a change to do this. The event handling in the xwin driver is
   not simple and so I would appreciate people robustly testing these
   changes to make sure I've not broken anything else.
  
  Thanks very much for taking on this tricky fix.
  
  I tried a lot of variations of x01c with -xor and -locate with various ways
  of closing the window and all was well.  I also tried multipage examples and
  all seemed well.  Finally, I tried -dev tk (which depends on -dev xwin
  code) using the command
  
  examples/c/x01c -dev tk
  
  and I get a hang from alt+F4 or any other method of closing the window.
  (BTW, to set up all the prerequisites for that command you can
  use make -j4 test_c_tk or make -j4 all.)
  
  I am not sure whether this -dev tk hang is a long-standing problem or the
  result of your recent change because up to now I have rarely tested closing
  the window, but it would be great if you would be willing to take a look.

I'm not sure about the tk driver status, as it's been a long time since I used
it substantially.  But I do use the plframe binding, a lot.  And I fear the
bug fix as implemented will be incompatible with that.  Here's the situation:
a user with a plplot-enhanced wish (the one we build in the package is named
plserver) launches a bunch of windows.  Then the user clicks on the go-away
button.  The xwin driver calls plexit() and the whole application shuts down.
Not good.  It should just exit that stream.

I haven't verified this experimentally, but an easy way to do so is using
examples/tk/tk03.  It uses a stock plserver for plotting (you can change
@plserver_LOCATION@ to be just . and run from the directory plserver is
sitting in).  Click on the Open new button to open a 2nd plframe.  Then
close it with the goaway button.  Only that window, and not the first, should
shut down.

-- 
Maurice LeBrun

--

___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] [ plplot-Bugs-2998260 ] -dev xwin shows fatal error when window closed

2010-05-07 Thread chm
On 5/7/2010 1:03 PM, SourceForge.net wrote:
 Summary: -dev xwin shows fatal error when window closed

 Initial Comment:
 For -dev xwin, when you close the window by alt+F4 or other equivalents, the 
 following fatal error message is the result:

 XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server

 This fatal error can be disruptive to certain environments (e.g., lisp)  and 
 should be replaced by a smooth exit from PLplot. as occurs under these same 
 circumstances for -dev qtwidget and -dev wxwidgets.



I took a look at xwin.c and it appears that a number of the X11
calls do not have check for error returns.  Perhaps this is the
origin of the problem.

--Chris

--

___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel