Created attachment 9201 [details] Contains PCL5 that crashes interpreter when read from stdin Steps to reproduce: pcl6-9.06-win32.exe - < temp2.prn pcl6-9.06-win32.exe version Version: 9.06 Build date: Wed Aug 08 12:56:22 2012
I doubt it crashes, looks like a dup of 693544, please reopen if there are any messages from the operating system reporting the program has crashed, and include the message contents.
Created attachment 9224 [details] Windows crash dialog 1
Created attachment 9225 [details] The other Windows crash dialog
Thanks I'll have a look, I don't want it to crash under any circumstances, that said you will need to find another way to run the interpreter for it to be useful. Once fixed it will not pause at each page.
There are a couple of problems here, first stdin will not work properly on windows without setting the mode to binary. In your particular test case there is a CTRL-Z inside a raster image that cause a premature end-of-file. This seems to heal it: diff --git a/pl/plmain.c b/pl/plmain.c index dd28a23..3559883 100644 --- a/pl/plmain.c +++ b/pl/plmain.c @@ -1424,9 +1424,10 @@ pl_main_cursor_open(const gs_memory_t *mem, ) { /* try to open file */ - if (fname[0] == '-' && fname[1] == 0) + if (fname[0] == '-' && fname[1] == 0) { cursor->strm = mem->gs_lib_ctx->fstdin; - else + gp_setmode_binary(cursor->strm, 1); + } else cursor->strm = fopen(fname, "rb"); if (!cursor->strm) return gs_error_ioerror; I will discuss this with other ghostscript developers and see if we want to do this change for the other languages also, if so the change will be made in the graphics library when stdin is set, in the meantime this patch can be used. The crash is another issue, it simply turns out that terminating the stream early puts the interpreter in an unexpected state, I'll fix that next.
Thank you for providing an interesting PCL test case we will add it to our regression test suite. Several changes were made in response to this report: commit 152d0cec22438acbb6a5cd50a65b0f9f8c729195 Author: Henry Stiles <henry.stiles@artifex.com> Date: Sat Jan 26 21:47:12 2013 -0700 Fix bug #693586 - clist error message. The error was caused by sending image data to the library after the page was output, now graphics mode is flushed and closed before the page is output. The bug was introduced by ea54a03 which closed graphics mode at the time of "end job" which could occur after output page. We do need to leave that commit intact as the job could end without outputting a page, and the raster state would not be cleaned up. commit 210c9344792bcf95c540f93428562c34104ffb28 Author: Henry Stiles <henry.stiles@artifex.com> Date: Thu Jan 24 12:58:58 2013 -0700 Set stdio streams to binary, bug #693543. This is exactly the same solution used in gs/base/dwmainc.c. The commit also removes extraneous include files. Updating the associated dwmain makefile target with the new include file dependencies is forthcoming. commit ea54a0304934c570a51ca5eec216b0480f2b5be5 Fixes interpreter crash see bug #693543. If a PCL job exited in the middle of a raster stream graphics mode was not terminated properly at the end of the job, instead we tried to shut down graphics later at the time of interpreter shutdown which leads to a unordered freeing of resources.