error: Invalid message (magic 0x00000000).

Vegard Nossum <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <CAOMGZ=EQa74FeFaCbAtsa-B7Lq78Ks4Ob84SXYRVzDNTVUrv8g@mail.gmail.com>
Hi,

When starting a lot of new screen windows in parallel, some windows
don't actually open, and I get some errors instead:

Invalid message (magic 0x00000000).
Invalid message (magic 0x736e6f69).

(the latter seems to be ASCII "snoi").

You can reproduce it e.g. this Python script:

8<-----------------------------------------------------------
import os
import shutil
import sys
import subprocess
import time

if not os.getenv('STY'):
   print >>sys.stderr, 'Need to run inside an existing screen session'
   sys.exit(1)

# create pids/
if os.path.exists('pids'):
   shutil.rmtree('pids')
os.mkdir('pids')

expected_n = 100
for i in range(expected_n):
   subprocess.check_call(['screen', 'bash', '-c', 'echo 1 > pids/$$'])

# give the processes above some time to start
time.sleep(5)

actual_n = len(os.listdir('pids'))

print "expected %u, got %u" % (expected_n, actual_n)
8<-----------------------------------------------------------

This will mostly print "expected 100, got 100", but sometimes it
prints "expected 100, got 99".

I've only found this earlier report (from 2005) of something similar:

https://lists.gnu.org/archive/html/screen-users/2005-01/msg00057.html

They are also starting a lot of windows in parallel, i.e.: "I'm
writing a system that puts a lot of windows (about 12) into a screen
session".

Are there any recent fixes or workarounds for this problem?

Thanks,


Vegard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.