diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-08-18 12:08:44 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-08-18 12:24:35 +0100 |
commit | b25538089b1b7ce33aac00d0cf10b32eeebd1a8b (patch) | |
tree | 7f0c22f48a5ff4c0d7e3fae9175d823abd34d68e /base/gxdevice.h | |
parent | f9461dab92a2270c371dfd1638918e642079a57f (diff) | |
download | ghostpdl-b25538089b1b7ce33aac00d0cf10b32eeebd1a8b.tar.gz |
Revert "Add gxdso_upcall mechanism, and use it in Nup device."
This reverts commit 2103d52da9519ded2af60f10aceab0ecd74da6a8.
While the concept of using 'upcalls' works, in that "higher" devices
can be correctly informed of changes in "lower" devices, it hits
problems in what you can actually do when the upcalls happen.
In this instance, we have an Nup device subclassing an epo device
subclassing a png16m device. Then png16m device spots a change in
mediasize, and so has to reallocate the memory its using. So
it sends an upcall.
The Nup device recieves the upcall, and decides to act on it, by
flushing the nest, thus sending outputpage to the epo device.
The epo device sends the fillpage and outputpage on, and unsubclasses
to remove itself from the chain. Due to the nature of unsubclassing
the png16m device moves from it's current allocated block INTO the
block previously used for the epo device. The old block is then
freed.
Upon return from the upcall, the png16m device tries to actually do
the realloc that it had been signalling for, but the pointer it
was holding is out of date, and we crash.
We have so far been protected from this by the fact that we're
always picking up the reallocs before they happen, and so nothing
happened on the upcalls. Attempting to remove that code showed
up the problem.
So we remove the upcall code entirely and will rely on the old
method of spotting parameter changes. If inspiration strikes us
as to how to make this work safely, we can pull this back out of
git.
Diffstat (limited to 'base/gxdevice.h')
-rw-r--r-- | base/gxdevice.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/base/gxdevice.h b/base/gxdevice.h index 6dff9cf44..ce69c72d8 100644 --- a/base/gxdevice.h +++ b/base/gxdevice.h @@ -678,6 +678,5 @@ int gx_update_from_subclass(gx_device *dev); int gx_subclass_composite(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev); void gx_subclass_fill_in_page_procs(gx_device *dev); -int gx_device_upcall(gx_device *dev, void *data, size_t size); #endif /* gxdevice_INCLUDED */ |