Bug 100863

Summary: When a process quits, xorg sometimes leaves a zombie window
Product: xorg Reporter: Vincent Lefevre <vincent-fdt>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: ajax, keithp
Version: 7.7 (2012.06)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vincent Lefevre 2017-04-28 11:25:52 UTC
When a process quits, xorg sometimes leaves a zombie window. This can be reproduced (not every time) with the following script. It starts 200 (by default) xterm's, which quit immediately (they just execute the "true" command):

----------------------------------------------------------------------------
#!/bin/sh

n=${1:-200}
n=$((n+0))

for i in `seq $n`; do xterm -geometry 80x24+$((2*i))+$((2*i)) -e true & done

wait
----------------------------------------------------------------------------

where several windows can remain on screen.

I can reproduce this bug on my Debian/unstable machine at least with fvwm and without a window manager. With fvwm, the window manager can still see the window, which can be moved, etc. Other users could also reproduce the bug (see Debian bug below).

Some operations make the window(s) disappear, such as the "xprop" utility (as soon as xprop is started).

This bug does not occur only with xterm. I could see it with GNU Emacs (its own interface) and xpdf as well.

I initially reported this bug in the Debian BTS:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855206
Comment 1 Vincent Lefevre 2017-04-28 12:32:28 UTC
I can reproduce the bug with:
  * 1.19.1 (Debian package xorg-server/2:1.19.1-4)
  * 1.19.3 (Debian package xorg-server/2:1.19.3-1)

but not with:
  * 1.18.4 (Debian package xorg-server/2:1.18.4-2)
Comment 2 Michel Dänzer 2017-04-29 02:24:06 UTC
Please attach the corresponding Xorg log file.
Comment 3 Michel Dänzer 2017-04-29 03:37:27 UTC
Bisected to:

f993091e7db81b0420e23c485378cba112278839 is the first bad commit
commit f993091e7db81b0420e23c485378cba112278839
Author: Keith Packard <keithp@keithp.com>
Date:   Thu May 26 10:40:44 2016 -0700

    os: Switch server to poll(2) [v3]
    
    Eliminates all of the fd_set mangling in the server main thread
    
    v2: Listen for POLLOUT while writes are blocked.
    
    v3: Only mark client not ready on EAGAIN return from read
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
Comment 5 Michel Dänzer 2017-05-01 01:04:19 UTC
Thanks for the report, fixed in Git master:

commit e2f68296ffb8e40035c0ebd949b67d1e2e424e11
Author: Keith Packard <keithp@keithp.com>
Date:   Sat Apr 29 00:26:10 2017 -0700

    os: Mark client as ready to read when closing due to write failure [100863]
Comment 6 Deepak Kumar 2017-05-02 04:48:07 UTC
Unable to reproduce this issue, please mention the steps to reproduce the issue.
Comment 7 Vincent Lefevre 2017-10-10 09:20:30 UTC
The Debian package has just been updated, and I confirm that the bug is fixed (with a test on 2 machines, before and after the upgrade).

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.