FW: Fix 687189 for bbox_forward_add_rect infinite recursion
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Fix 687189 for bbox_forward_add_rect infinite recursion.
This problem caused segment faults or apparent hangs with
the x11alpha device. This fix also works for 656414
segfault when using x11alpha
DETAILS:
The problem was due to the bounding box device creating
more and more bounding box devices in the device chain
when the overprint compositor was being used. The x11alpha
device uses the bounding box device. The overprint logic
uses the 'create compositor' logic when a change is made
in the status of the overprint or overprint mode parameters.
However a new compositor is not created each time. Instead
the overprint device simply updates its parameters. The
bounding box device has its own create compositor. This
routine would call its target device's create compositor
routine and then wraps a new bounding box device around the
target's compositor. The combination of many create
compositor calls from the overprint logic and the fact that
the bounding box device adds a new bounding box device
could result in hundreds of bounding devices in the chain.
The fix consists of checking if the bounding box's target
device actually created a new compositor device. Only when
a new compositor was added is a new bounding box also added
to the chain.
[End log message]
diff -u -r1.15 gdevbbox.c
--- a/src/gdevbbox.c 14 Oct 2003 12:43:18 -0000 1.15
+++ b/src/gdevbbox.c 8 Apr 2004 03:27:41 -0000
@@ -1170,8 +1170,11 @@
int code = (*dev_proc(target, create_compositor))
(target, &cdev, pcte, pis, memory);
- if (code < 0)
+ /* If the target did not create a new compositor then we are done.
*/
+ if (code < 0 || target == cdev) {
+ *pcdev = dev;
return code;
+ }
bbcdev = gs_alloc_struct_immovable(memory, gx_device_bbox,
&st_device_bbox,
"bbox_create_compositor");
This problem was noticed with the following test files in
addition to the original file in the problem report. This
fix corrects the original problem. However another problem
is visible with some of the files. The files marked with an
'X' erase the page after drawing the entire page. The files
marked with an 'XX' erase the page one or more times while
drawing the page.
1_2001.pdf X
Altona-Testsuite_p2_S_x3.pdf
Altona.Page_3.2002-09-27.pdf X
BEST8-99-Path.fh7.pdf X
BW0696FOLD1FRONT.pdf
CAIB_highres_page4.pdf
CIDembedded.pdf
Fixed_Original.pdf X
HeiseiMinStd.pdf
ICPconcept.pdf
Openhuis_pdf_zw.pdf XX
Original.pdf X
S2_Digitalproof-Forum_circles.pdf X
S2_Digitalproof-Forum_x3k.pdf
Testform.v1.0.2.pdf XX
adesso8.pdf
file.pdf X
messenger.pdf X
messenger16.pdf X
non-sepqxd2distiller.pdf X
test.pdf
p02.pdf X
plt_paper_503.eps XX
Due to the difference is the symptoms, I am assuming that this
is a different problem (possibly related). I have verified that
with this fix, the chains of multiple bounding box devices is
not created with these files. I am creating a new bug report for
this latter problem.
Dan