Summary: | Issue when using pipe as output | ||
---|---|---|---|
Product: | GhostPCL | Reporter: | Marcos H. Woehrmann <marcos.woehrmann> |
Component: | PCL interpreter | Assignee: | Marcos H. Woehrmann <marcos.woehrmann> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
Marcos H. Woehrmann
2012-01-26 05:53:00 UTC
Further testing shows that directing OutputFile to stdout via '-' does not result in indeterminisms: ./pcl6 -sOutputFile=- -sDEVICE=pbmraw -r75 -dNOPAUSE -dBATCH ./fts.0120 | cat >./stdout.pbm md5sum stdout.pbm If you still see it Marcos, assign it back, thanks. commit dcf401ee8172aaff5363b2fc86e166f73225e429 Author: Henry Stiles <henry.stiles@artifex.com> Date: Tue Mar 20 16:56:36 2012 -0600 Close the device before exiting PCL, XPS and friends. The languages deallocated the memory associated with a device but never did the associated gs_closedevice(). This might have some effect on 692816 where indeterminate output was observed on stdout. Without the close device call the "OutputFile" was never actually closed (fclose), and so there might have been a missing flush. All of that is speculation, I wasn't able to reproduce the indeterminism - but we want the closedevice anyway so here it is. diff --git a/pl/plmain.c b/pl/plmain.c index 60c66ea..333dbce 100644 --- a/pl/plmain.c +++ b/pl/plmain.c @@ -621,10 +621,10 @@ pl_main_universe_dnit( return -1; } - /* dealloc device if sel'd */ + /* close and dealloc the device if selected. */ if (universe->curr_device) { + gs_closedevice(universe->curr_device); gs_unregister_root(universe->curr_device->memory, &device_root, "pl_main_universe_select"); - /* ps allocator retain's the device, pl_alloc doesn't */ gx_device_retain(universe->curr_device, false); universe->curr_device = NULL; } Summary of changes: pl/plmain.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) I can confirm the problem is fixed. Many thanks for finding this. It simplifies regression testing. |