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

Bug#998888: marked as done (X-device: BadDrawable (invalid Pixmap or Window parameter))



Your message dated Fri, 19 Nov 2021 19:06:20 +0100
with message-id <163734518082.85939.12822538040902393595@auryn.jones.dk>
and subject line Re: Bug#998888: X-device: BadDrawable (invalid Pixmap or Window parameter)
has caused the Debian Bug report #998888,
regarding X-device: BadDrawable (invalid Pixmap or Window parameter)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
998888: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998888
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: ghostscript-x
Version: 9.54.0~dfsg-5
Severity: normal
Tags: patch

Dear Maintainer,

upstream commit 033ed8bf196b1cddd681a9b32d9398bf6bc02d24 (included in
debian/9.54.0~dfsg-1) introduced a call to XFreePixmap in gdev_x_close.
This might free a pixmap that was created by ghostview as a backing
pixmap and might still be used by ghostview for further drawing.

I'm not entirely sure which files causes the gs process to close the device
early, but with some files it does and gv actions like reloading/zooming
attempt to draw on the already freed pixmap and cause gv to crash with

X Error of failed request:  BadPixmap (invalid Pixmap parameter).

Especially the -watch option of gv is broken if it is used to watch a
postscript file that's in development. Any postscript error will cause the
device to free the backing pixmap and ghostview will crash even if the
error in the file gets fixed. It was possible to do that in the past (the
backing pixmap was reused with a new gs process).

It's possible to reproduce the issue with a small example file like this:

newpath
100 200 moveto
200 250 lineto
100 300 lineto
2 setlinewidth
stroke

Please note that there is no "showpage", which seems to cause the invocation
of gdev_x_close (with showpage, the gs process keeps running). With such a
file gv will crash when trying to zoom / reload etc. (ghostview needs to run
with backing pixmap enabled (-pixmap), the -nopixmap option will of course
work around the bug).

I attached a simple patch that checks if the pixmap is created by ghostview
(xdev->ghostview is set) and only frees it if that's not the case.

Cheers,
Florian


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (550, 'testing'), (210, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 4.14.151-64+ (SMP w/96 CPU threads; PREEMPT)
Kernel taint flags: TAINT_DIE
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages ghostscript-x depends on:
ii  ghostscript  9.54.0~dfsg-5bfw3
ii  libc6        2.32-4bfw1
ii  libx11-6     2:1.7.2-2+b1
ii  libxt6       1:1.2.0-1

ghostscript-x recommends no packages.

ghostscript-x suggests no packages.

-- no debconf information
>From c924286b5844456605eb8a7e449cf66e1e220a76 Mon Sep 17 00:00:00 2001
From: Florian Lindemann <linde@bfw-online.de>
Date: Tue, 9 Nov 2021 14:56:49 +0100
Subject: [PATCH] patch

---
 devices/gdevxini.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devices/gdevxini.c b/devices/gdevxini.c
index 82032cd6..a2f96240 100644
--- a/devices/gdevxini.c
+++ b/devices/gdevxini.c
@@ -960,7 +960,7 @@ gdev_x_close(gx_device_X *xdev)
         xdev->gc = NULL;
     }
     if (xdev->dpy && xdev->bpixmap != (Pixmap)0) {
-        XFreePixmap(xdev->dpy, xdev->bpixmap);
+        if (!xdev->ghostview) XFreePixmap(xdev->dpy, xdev->bpixmap);
         xdev->bpixmap = (Pixmap)0;
         xdev->dest = (Pixmap)0;
     }
-- 
2.33.0


--- End Message ---
--- Begin Message ---
Version: 9.55.0~dfsg-1

Quoting Jonas Smedegaard (2021-11-09 15:36:03)
> Quoting Florian Lindemann (2021-11-09 15:02:43)
> > I attached a simple patch that checks if the pixmap is created by 
> > ghostview (xdev->ghostview is set) and only frees it if that's not 
> > the case.
> 
> Thanks - also for the detailed explanation.
> 
> Since this is an issue in Ghostscript itself (not its packaging) and 
> you are more knowledgeable than me, could you please report this 
> upstream at the Ghostsript issue tracker yourself?
> 
> https://bugs.ghostscript.com/

This issue is fixed in ghostscript 9.55.0~dfsg-1

Thanks,

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature


--- End Message ---

Reply to: