octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39504] fclose ("all") stops gnuplot pipes cre


From: Rik
Subject: [Octave-bug-tracker] [bug #39504] fclose ("all") stops gnuplot pipes creating graphics errors
Date: Fri, 19 Jul 2013 15:49:03 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

Update of bug #39504 (project octave):

                Category:                Plotting => Plotting with gnuplot  
              Item Group:                   Crash => Incorrect Result       
                  Status:                    None => Confirmed              
                 Summary: Instrument contol script only runs once... plot
crashes on second run. => fclose ("all") stops gnuplot pipes creating graphics
errors

    _______________________________________________________

Follow-up Comment #2:

I'm guessing that this is only a problem with the gnuplot toolkit.  Have you
tried running the script with the FLTK toolkit?

For gnuplot, I can definitely reproduce this with the following:


graphics_toolkit gnuplot
plot (1:10)
fclose ("all");
close


The problem is that gnuplot is a separate program outside of Octave.  To
communicate with it we open up pipes.  When you use 'fclose all' you are
closing every pipe and file handle throughout Octave except for STDIN, STDOUT,
and STDERR.  Unfortunately there is no notification to Octave that the pipe
has been closed so the next time you try and do something with graphics Octave
encounters this unexpected situation and starts throwing errors.

As an immediate workaround, I would not use 'fclose all'.  Instead, you should
be tracking the file descriptors that you open and closing them individually.


fid = fopen (...);
... some code here ...
close (fid);



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39504>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]