attach to byobu crashes on hardy

Bug #375309 reported by Rocco
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Fix Released
High
Dustin Kirkland 

Bug Description

# screen -r
Unable to open "/tmp/byobu-hax21933".

And before doing that I can verify that there is no file called this in /tmp.
From process list before attach:
root 21935 0.5 0.1 5104 3044 ? Ss 09:07 0:00 /usr/bin/SCREEN.real -c /tmp/byobu-hax21933 /bin/bash /usr/bin/motd+shell /tmp/byobu-hax21933

ii byobu 2.2-0ubuntu1~ppa1
ii screen 4.0.3-7ubuntu1.1~ppa2

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 375309] [NEW] attach to byobu crashes on hardy

Hello,

Can you please run the following, and attach /tmp/out

 $ sh -x /usr/bin/screen true 2>/tmp/out

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Also, please run this, and attach /tmp/out:
 $ sh -x /usr/bin/screen 2>/tmp/out

:-Dustin

Revision history for this message
Rocco (rocco) wrote :

sh -x /usr/bin/screen true 2>/tmp/out

+ OLDPKG=screen-profiles
+ PKG=byobu
+ [ -d /root/. -a ! -e /root/.byobu ]
+ [ -d /root/.byobu ]
+ [ -n -a -r ]
+ SCREENRC=/root/.screenrc
+ [ -r /root/.screenrc -a ! -e /root/.byobu/profile -a ! -h /root/.byobu/profile ]
+ DEFAULT_PROFILE=light
+ profile=/root/.byobu/profile
+ [ -h /root/.byobu/profile ]
+ [ -h /root/.byobu/profile -a ! -r /root/.byobu/profile ]
+ [ ! -r /root/.byobu/profile ]
+ [ -s /root/.byobu/keybindings ]
+ sed -i s/screen-profiles/byobu/g /root/.byobu/keybindings
+ [ -r /root/.byobu/windows ]
+ [ -r /root/.screenrc ]
+ [ 1 = 0 ]
+ exec /usr/bin/screen.real -c /root/.byobu/profile true

sh -x /usr/bin/screen 2>/tmp/out

+ OLDPKG=screen-profiles
+ PKG=byobu
+ [ -d /root/. -a ! -e /root/.byobu ]
+ [ -d /root/.byobu ]
+ [ -n -a -r ]
+ SCREENRC=/root/.screenrc
+ [ -r /root/.screenrc -a ! -e /root/.byobu/profile -a ! -h /root/.byobu/profile ]
+ DEFAULT_PROFILE=light
+ profile=/root/.byobu/profile
+ [ -h /root/.byobu/profile ]
+ [ -h /root/.byobu/profile -a ! -r /root/.byobu/profile ]
+ [ ! -r /root/.byobu/profile ]
+ [ -s /root/.byobu/keybindings ]
+ sed -i s/screen-profiles/byobu/g /root/.byobu/keybindings
+ [ -r /root/.byobu/windows ]
+ [ -r /root/.screenrc ]
+ [ 0 = 0 ]
+ mktemp -t byobu-XXXXXXXX
+ temp=/tmp/byobu-CwC19723
+ cat /root/.byobu/profile /root/.byobu/windows
+ [ -n /bin/bash -a -x /bin/bash ]
+ exec /usr/bin/screen.real -c /tmp/byobu-CwC19723 /bin/bash /usr/bin/motd+shell /tmp/byobu-CwC19723

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 375309] Re: attach to byobu crashes on hardy

Okay, how about

 $ ls -alF / | grep tmp

I'm checking the permissions on your /tmp directory.

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Also, could you try one thing ...

Make a backup copy of /usr/bin/motd+shell, and edit the original.

Comment out the line that says:

[ -n "$1" -a -w "$1" ] && rm -f "$1" 2>/dev/null

This will disable the cleanup of the tempfile. Once you've done this,
try running this again:

 $ sh /usr/bin/screen 2>/tmp/out

Check the output of /tmp/out for the name of the tempfile. See if that exists.

:-Dustin

Revision history for this message
Rocco (rocco) wrote :

Well root has access to /tmp. The /tmp/byobu-XXXXXXX is removed when screen.real executes.

drwxrwxrwt 4 root root 112 2009-05-12 16:25 tmp

Revision history for this message
Rocco (rocco) wrote :

removing [ -n "$1" -a -w "$1" ] && rm -f "$1" 2>/dev/null makes it work, but has the side effect that
/tmp/byobu-tpM10227 isn't removed when screen exits.

+ OLDPKG=screen-profiles
+ PKG=byobu
+ [ -d /root/. -a ! -e /root/.byobu ]
+ [ -d /root/.byobu ]
+ [ -n -a -r ]
+ SCREENRC=/root/.screenrc
+ [ -r /root/.screenrc -a ! -e /root/.byobu/profile -a ! -h /root/.byobu/profile ]
+ DEFAULT_PROFILE=light
+ profile=/root/.byobu/profile
+ [ -h /root/.byobu/profile ]
+ [ -h /root/.byobu/profile -a ! -r /root/.byobu/profile ]
+ [ ! -r /root/.byobu/profile ]
+ [ -s /root/.byobu/keybindings ]
+ sed -i s/screen-profiles/byobu/g /root/.byobu/keybindings
+ [ -r /root/.byobu/windows ]
+ [ -r /root/.screenrc ]
+ [ 0 = 0 ]
+ mktemp -t byobu-XXXXXXXX
+ temp=/tmp/byobu-tpM10227
+ cat /root/.byobu/profile /root/.byobu/windows
+ [ -n /bin/bash -a -x /bin/bash ]
+ exec /usr/bin/screen.real -c /tmp/byobu-tpM10227 /bin/bash /usr/bin/motd+shell /tmp/byobu-tpM10227

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hmm, strange.

I suppose motd+shell must be removing the temp file too quickly,
before screen.real has had a chance to read it.

I'll have to think on this one a bit.

Since I can't reproduce this, I'll probably need you to test a fix,
once I have it :-)

:-Dustin

Revision history for this message
Rocco (rocco) wrote :

It's not a especially fast server I'm running it on. 2x2.4 xeon with sata drives, and 2 gigs of memory.

I will be able to try a fix when you have thought about it :)

But from my understanding the motd-shell is executing when screen starts, and then removes the /tmp/byobu file?

When detaching one screen session with ctrl-a d, or f6, and returning again with screen -r this file is needed by screen? So maybee it should only be removed when screen is stopped.

Sorry if I missread the code totally.

I produce the problem on hardy by doing (working ok on jaunty)
screen
f6
screen -r

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

What version of byobu are you running on each of these two systems,
hardy and jaunty?

:-Dustin

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Ah, okay, now I have reproduced this. It was not clear to me until
your last message that this happens when doing a detach, then
re-attach.

Looks like this is a difference in the way the screen binary on hardy
behaves, from the one in jaunty. I'll need to do some digging.

:-Dustin

Changed in byobu:
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Deeps (deepseth) wrote :

running:

byobu 2.3-0ubuntu1~ppa1
byobu-extras 2.3-0ubuntu1~ppa1
screen 4.0.3-7ubuntu1.1~ppa2

(screen was upgraded to the package in the byobu PPA)

on

Description: Ubuntu 8.04.2
Release: 8.04
Codename: hardy

2.6.24-24-generic #1 SMP Wed Apr 15 15:54:25 UTC 2009 i686 GNU/Linux

and i too am unable to reattach to a screen session after detaching.

$ screen -r
Unable to open "/tmp/byobu-xHC31224".

have tried reverting to
screen 4.0.3-7ubuntu1
(as packaged by default in hardy)
but the problem remains:

$ screen -r
Unable to open "/tmp/byobu-TPD31569".

however, both version function correctly when byobu is not installed.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I have a good, clean fix for this, will be in 2.4 release.

:-Dustin

Changed in byobu:
status: Confirmed → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.