[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 Tue, 30 Nov 2021 11:33:55 +0000
with message-id <E1ms1OV-0005XG-HX@fasolo.debian.org>
and subject line Bug#998888: fixed in ghostscript 9.55.0~dfsg-3
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 ---
Source: ghostscript
Source-Version: 9.55.0~dfsg-3
Done: Jonas Smedegaard <dr@jones.dk>

We believe that the bug you reported is fixed in the latest version of
ghostscript, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 998888@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated ghostscript package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 30 Nov 2021 15:46:45 +0100
Source: ghostscript
Architecture: source
Version: 9.55.0~dfsg-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Printing Team <debian-printing@lists.debian.org>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Closes: 998888
Changes:
 ghostscript (9.55.0~dfsg-3) unstable; urgency=medium
 .
   * add patch cherry-picked upstream
     to fix the logic for freeing X pixmap;
     really closes: bug#998888, thanks again to Florian Lindemann
Checksums-Sha1:
 58ea3dc83bf6b1d1d4c9f0d0c6f1152787a94f38 2692 ghostscript_9.55.0~dfsg-3.dsc
 d3725eb1b876720a089632dbab2fdc1c9dca5d9b 116556 ghostscript_9.55.0~dfsg-3.debian.tar.xz
 77c9052620869ed2fb22e6ab930d594a9ed4251f 12234 ghostscript_9.55.0~dfsg-3_amd64.buildinfo
Checksums-Sha256:
 649811bbead31a45a0cd530de75039765a1a86fd375768c81a2e7a9a15463488 2692 ghostscript_9.55.0~dfsg-3.dsc
 5e6dce2876789378608c65d346686deb0b6aee4b65c292fa6e8bd737c8a3c2e7 116556 ghostscript_9.55.0~dfsg-3.debian.tar.xz
 c800d1d020f3e2700953d48e3e005863883bf70662bacd71c88584e5e3c2873a 12234 ghostscript_9.55.0~dfsg-3_amd64.buildinfo
Files:
 d530376255197360c6e4659af6344228 2692 text optional ghostscript_9.55.0~dfsg-3.dsc
 f77fc863e45e591422d40bb59341014d 116556 text optional ghostscript_9.55.0~dfsg-3.debian.tar.xz
 52ad0f1122eb76c2c7769ea87db9a259 12234 text optional ghostscript_9.55.0~dfsg-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmGmOjkACgkQLHwxRsGg
ASFSXxAAhVTAecEDXkRKsZXTMgfzS2GL80fYLk0+8botubWsLL9VtLsHC0UyPRj+
HeHbrLxuwt/nA+HVVZCnFd1zp1pbYgKXoUYsn+Hkta27qpD2NHE40dKBt0r+Qu0y
QYxmt/LjljG6OtZme9poGS/c9m2g9tUQvBPtABv18g1AF7hDFQLTinCblVabiw8N
3hhSBy+1DtqWzPhmqc1I6t83i8EunWwcyA/LsnDSxUVO7TT84X6ihCsHNgblxI3d
e6QWPFrM6dM6IYCmq9FrzLGp5MDeP466UIdRLqE8+SktZyqfI2jyaKWU+LLY+rLa
yEMoWjgcLCkhkDHiepS4w6C1lyeBsI4c3MkIZ36/utekPwQ70RRf54AQ8ivRyZuu
8gQYBtM4A9b1Nv7DDzxVo/68c/UGXx0apdczqoEee+E+UH+9zYmdCd0NtvPJO/FY
a4NJ2jBp6vNuTvP5E6Em2Z2KpGHmV+CAwiOAn4+/Rq0mwQkc+0m1v8yvvQyMjB71
IfUDQg1UsbO3Q7mrcrUSVGEih+wIF/3q07BWGvtRBI2fSoWJhsoba4s3pp6Excks
sy6GFBV0luZM0u2GOQrN7Q6gGa66bzEnF+gBrBSIGW0gIxY37pAGvqafk6LGd3hg
hSvuz+/Qnv4LOyqQYkg1d1Q9Uii+9VH7BeLqhuqHFtfrqXStt7k=
=yQKv
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: