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

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

[Octave-bug-tracker] [bug #49718] Octave crashes on print/saveas etc whe


From: Rik
Subject: [Octave-bug-tracker] [bug #49718] Octave crashes on print/saveas etc when installed on a directory with parenthesis
Date: Fri, 2 Dec 2016 00:07:17 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #17, bug #49718 (project octave):

I put gs.exe in the directory


c:\gs 2\


Using 


debug_on_error (1)
plot (1:10)
print -deps junk.eps


I get


'c:\gs' is not recognized as an internal or external command,
operable program or batch file.
error: gl2ps_renderer::draw: internal pipe error
error: called from
    __opengl_print__ at line 169 column 7
    print at line 503 column 14
stopped in
C:\Octave\Octave-4.2.0\share\octave\4.2.0\m\plot\util\private\__openg
l_print__.m at line 169
169:       drawnow (gl2ps_device{n}, ['|' pipeline{n}]);


Inspecting variables in the m-file, pipeline{n} is


"c:\gs 2\gs.exe" -dQUIET -dNOPAUSE -dBATCH -dSAFER -dAutoRotatePages=/None -
sDEVICE=eps2write -sOutputFile=""junk.eps"" -


print.m is trying to protect the command by placing it in double quotes, but
this may not be enough.

Lookin in gl2ps_print.cc, there is only one place where the phrase "internal
pipe error" occurs which is when Octave fails to read from the temporary file
containing gl2ps output and write to the pipe created with octave_popen.

The code that opens the pipe is 


// Create process and pipe gl2ps output to it.

std::string cmd = stream.substr (1);

fp = octave_popen (cmd.c_str (), "w");

if (! fp)
  error ("print: failed to open pipe \"%s\"", stream.c_str ());

frame.add_fcn (safe_pclose, fp);


So we check immediately to see if the pipe was created successfully. 
Apparently, you can create the pipe but having any old command is fine because
it doesn't really invoke it until something is written to the input side of
the pipe.

The segfault is caused eventually by


if (nwrite != nread)
  {
    octave::signal_handler ();   // Clear SIGPIPE signal
    error ("gl2ps_renderer::draw: internal pipe error");
  }


This is a known problem.  Because we have different threads running, when
error() is called it seems to not pick up our installed error handler and
return to the Octave prompt.  Instead, it picks up the default which is
exit().


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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