Oh, I had almost forgotten about this bug! Thank you for handling it.
I tried to reproduce now on Debian stable but, like you, I failed.

BR,
/Jorgen

On Wed May 20 14:59:01 2026, [email protected] wrote:
> This is an automatic notification regarding your Bug report
> which was filed against the screen package:
> 
> #502360: Race conditions with 'screen -X cmd' and 'screen cmd' cause logging 
> to file to fail
> 
> It has been closed by Peter Dey <[email protected]>.
> 
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Peter Dey 
> <[email protected]> by
> replying to this email.
> 
> 
> -- 
> 502360: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502360
> Debian Bug Tracking System
> Contact [email protected] with problems

> Date: Wed, 20 May 2026 16:56:40 +0200
> From: Peter Dey <[email protected]>
> To: [email protected]
> Subject: Cannot reproduce on a modern screen
> Message-ID: <[email protected]>
> 
> Version: 4.9.0-4
> 
> Hi,
> 
> I've tried to reproduce this using the supplied script, even up to 20
> sessions with no sleep delay.  I get 20 windows with 20 log files.
> 
> I can't reproduce this on a modern screen version (either 4.9.0-4 or
> 5.0.1-2).
> 
> I presume this was fixed a long time ago, but marking as fixed in the oldest
> version I tested.
> 
> Cheers,
> Peter

> Date: Wed, 15 Oct 2008 23:31:37 +0200
> From: Jorgen Grahn <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Subject: Race conditions with 'screen -X cmd' and 'screen cmd' cause
>  logging to file to fail
> Message-ID: <[email protected]>
> X-Mailer: reportbug 3.31
> 
> Package: screen
> Version: 4.0.3-0.3
> Severity: normal
> 
> 
> At work, we automate things with screen, invoked from shell scripts. Among
> other things, the scripts create new, named windows and turn on logging for
> them. This broke when we upgraded from 4.0.2 to screen 4.0.3.
> 
> (Actually, we run RedHat Enterprise Linux, but the problem is repeatable with
> Debian.  Either upstream 4.0.3 did this, or RH and Debian include the same
> bad patch.)
> 
> The symptom is that if you create windows too fast (by calling the screen 
> binary)
> and send commands too fast (by calling screen -X cmd) some of them will fail.
> It's easy to see if you start a screen and run this shell script:
> 
> ------------------------------
> #!/bin/sh
> 
> [ -z "$STY" ] && {
>     echo "no screen"
>     exit 1
> }
> 
> mkdir -p /tmp/qgrajor || exit 1
> 
> for name in $(seq 1 5) ; do
>     name="screen_$name"
>     screen -t "$name" sort
>     # sleep 1 # enabling this delay "fixes" the problem
>     screen -p "$name" -X logfile "/tmp/bug-$name"
>     screen -p "$name" -X log on
> done
> ------------------------------
> 
> What typically happens is that screen_5 doesn't get logging enabled,
> but other problems may happen too (other windows not having logging,
> maybe also windows not opening).
> 
> I feel this is a serious regression because it prevents automation. I can add
> a delay like the one commented out above, but I have no idea if one second
> is always sufficient. It's not a good workaround.
> 
> regards,
> Jorgen
> 
> -- System Information:
> Debian Release: 4.0
>   APT prefers stable
>   APT policy: (500, 'stable')
> Architecture: powerpc (ppc)
> Shell:  /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.18-3-powerpc
> Locale: LANG=sv_SE.utf8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)
> 
> Versions of packages screen depends on:
> ii  base-passwd            3.5.11            Debian base system master 
> password
> ii  debconf [debconf-2.0]  1.5.11etch2       Debian configuration management 
> sy
> ii  libc6                  2.3.6.ds1-13etch7 GNU C Library: Shared libraries
> ii  libncursesw5           5.5-5             Shared libraries for terminal 
> hand
> ii  libpam0g               0.79-5            Pluggable Authentication Modules 
> l
> ii  passwd                 1:4.0.18.1-7      change and administer password 
> and
> 
> screen recommends no packages.
> 
> -- debconf information:
>   screen/old_upgrade_prompt: false
> 
> 


-- 
  // Jörgen Grahn                  | mot du jour: tambur              
\X/ <[email protected]>         |                                  

Reply via email to