screen freezes up, turns zombie

Bug #375625 reported by nicholas a. evans
58
This bug affects 16 people
Affects Status Importance Assigned to Milestone
screen
Unknown
Unknown
byobu (Ubuntu)
Invalid
High
Unassigned
screen (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: screen

Ubuntu 9.04
screen 4.0.3-11ubuntu4
screen-profiles 1.44-0ubuntu1.1
gnome-terminal 2.26.0-0ubuntu2
vim 2:7.2.079-1ubuntu5

When running vim inside screen, using the new screen-profiles, screen periodically crashes. The "client" screen process just freezes up until it is killed (i.e. tab in gnome-terminal is closed). All of the children are immediately killed/lost, and the backend screen process goes zombie.

I cannot reproduce reliably, but it seems to only happen when vim "shells out" (e.g. calling :grep, generating ctags, etc), and it seems to happen more frequently when the terminal is very large. I never saw this prior to upgrading to jaunty and installing screen-profiles.

from "ps faux":
nevans 18386 0.1 0.6 41908 18904 ? Rl May11 2:24 gnome-terminal
nevans 18387 0.0 0.0 2036 656 ? S May11 0:00 \_ gnome-pty-helper
nevans 18388 0.0 0.1 6720 3356 pts/0 Ss May11 0:00 \_ bash
nevans 18940 0.0 0.0 4168 984 pts/0 S+ May11 0:00 | \_ /usr/bin/screen.real -c /home/nevans/.screen-profiles/profile
nevans 18941 0.2 0.0 0 0 ? Zs May11 3:44 | \_ [screen.real] <defunct>

== (nevans@nevans-laptop) [Tue May 12]-(14:44:10) ==
~/src/mdlogix/crms/wustl-trunk $ screen -r
There are screens on:
 18941.pts-0.nevans-laptop (05/11/2009 10:46:36 AM) (Dead ???)
 12479.pts-1.nevans-laptop (05/05/2009 10:16:48 AM) (Dead ???)
Remove dead screens with 'screen -wipe'.
There is no screen to be resumed.
== (nevans@nevans-laptop) [Tue May 12]-(14:44:57) ==
~/src/mdlogix/crms/wustl-trunk $ screen -wipe
There are screens on:
 18941.pts-0.nevans-laptop (05/11/2009 10:46:37 AM) (Removed)
 12479.pts-1.nevans-laptop (05/05/2009 10:16:49 AM) (Removed)
2 sockets wiped out.
No Sockets found in /var/run/screen/S-nevans.

While I suspect this bug is triggered by something used by the screen-profiles config, I haven't run jaunty's version of screen without screen-profiles for long enough to say whether or not it is.

Maybe this is related to https://bugs.launchpad.net/ubuntu/+source/screen/+bug/315237/ or https://bugs.launchpad.net/ubuntu/+source/screen/+bug/244442/ ?

Related branches

Changed in byobu (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → High
Revision history for this message
Micah Cowan (micahcowan) wrote :

Could it possibly be the same bug, or at least related to https://savannah.gnu.org/bugs/?26742 ?

The fact that the backend crashes strongly suggests to me that it's not screen-profiles's/byobu's fault (though it may have generated the config that triggers the bug in screen). Even if screen-profiles's /usr/bin/screen wrapper does something a little screwy with spawning the "real" screen, that should not affect the forked background process.

Changed in screen (Ubuntu):
assignee: nobody → nicholas a. evans (nevans)
status: New → Incomplete
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Marking invalid against byobu. I have never been able to reproduce this.

:-Dustin

Changed in byobu (Ubuntu):
status: New → Invalid
Changed in byobu (Ubuntu):
assignee: Dustin Kirkland (kirkland) → nobody
Revision history for this message
nicholas a. evans (nevans) wrote :

I had only been hit occasionally by this bug over the last several months, and I've just been ignoring it. But, by chance or by special circumstances, I've triggered the bug three times today... before lunch. So it's really getting on my nerves.

I do think that the bug is in screen (not byobu), and it seems likely that it's the same as https://savannah.gnu.org/bugs/?26742, as Micah suggested. I just looked it up, and that bug has a patch which is believed to work (and will be included in screen 4.1). Since this bug can potentially result in data-loss, and there are a lot of people affected by it, is there any chance we could get a new package built using the patch, either in karmic-updates or at least in a PPA? (If this keeps annoying me, and someone else doesn't have time/inclination to post a package, my next weekend project might need to be learning how to build deb packages and create a PPA.)

Thanks!

Revision history for this message
nicholas a. evans (nevans) wrote :

I haven't upgraded to maverick yet, but I did recently switch to use the "awesome" window manager, and that has dramatically increased the frequency that I trigger this bug (triggering the bug seems to be a matter of switching back and forth between a high and low column count while displaying vim or a similar program). I noticed several things:

http://savannah.gnu.org/bugs/?26742 was fixed in September of 2009, but a major release hasn't been made since then and the patches don't seem to have ever made their way into a minor release.

From another LP bug report, in Maverick, matching my details almost exactly (https://bugs.launchpad.net/ubuntu/+source/screen/+bug/656396) I gather that this patch hasn't yet made it into Debian or Ubuntu. I suspect that https://bugs.launchpad.net/ubuntu/+source/screen/+bug/369184 is also related.

From my recent /var/log/kern.log*:

Oct 6 11:32:50 arrakis kernel: [22213.433002] screen[5598]: segfault at 18 ip 00007f3cb06481c3 sp 00007fffad6107c0 error 4 in libc-2.11.1.so[7f3cb05ce000+17a000]
Oct 6 21:23:59 arrakis kernel: [57682.092950] screen[782]: segfault at 18 ip 00007ff2fff3f1c3 sp 00007fff16ffd460 error 4 in libc-2.11.1.so[7ff2ffec5000+17a000]
Oct 7 11:20:36 arrakis kernel: [103639.433370] screen[3829]: segfault at 18 ip 00007f73d794b1c3 sp 00007fff267f6bd0 error 4 in libc-2.11.1.so[7f73d78d1000+17a000]
Oct 7 15:21:35 arrakis kernel: [118098.062706] screen[30186]: segfault at 18 ip 00007faf9e4c21c3 sp 00007fff079d5830 error 4 in libc-2.11.1.so[7faf9e448000+17a000]
Oct 11 13:19:09 arrakis kernel: [284508.558063] screen[9936]: segfault at 18 ip 00007f5f72ba01c3 sp 00007fff0ed43750 error 4 in libc-2.11.1.so[7f5f72b26000+17a000]
Oct 11 14:00:50 arrakis kernel: [287009.793219] screen[4099]: segfault at 18 ip 00007fa5ee7da1c3 sp 00007fff058cc710 error 4 in libc-2.11.1.so[7fa5ee760000+17a000]

Changed in screen (Ubuntu):
assignee: nicholas a. evans (nevans) → nobody
Revision history for this message
nicholas a. evans (nevans) wrote :

On second look, I don't think this bug necessarily shares anything with #656395.

summary: - screen freezes up, turns zombie (new in jaunty w/ screen-profiles)
+ screen freezes up, turns zombie
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks for pointing to the upstream bug. I'll try to cherry pick that patch and get a test package applied. I, myself, haven't been able to reproduce this yet. If I build a test package for you, can you try it out and confirm/deny the fix?

Changed in screen (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
nicholas a. evans (nevans) wrote : Re: [Bug 375625] Re: screen freezes up, turns zombie

I can reproduce the bug very reliably:

* open up a terminal window (unmaximized),
* start screen,
* start vim,
* run :grep (or something similar) and verify that it works
* maximize terminal window,
* drop the font size a couple of times,
* rerun the exact same :grep (etc)

and now the entire screen session has crashed.

This never fails to reproduce the bug for me.

I would be very happy to try out out a test package for you.

Changed in screen (Ubuntu):
assignee: Dustin Kirkland (kirkland) → nobody
Revision history for this message
Malcolm Scott (malcscott) wrote :

See also bug #727741 - this possibly-buggy version of screen may be left behind when screen-profiles is removed.

Revision history for this message
Alex Grubb (agrubb) wrote :

I can also reliably reproduce this crash following the steps Nicholas posted, as long as the resulting terminal is over 255 columns. Seems to be related to the fix already posted.

This may be a root cause of: https://bugs.launchpad.net/byobu/+bug/644825

I do not have the issue described in bug #727741.

I would also be happy to try out a test package.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package screen - 4.0.3-14ubuntu8

---------------
screen (4.0.3-14ubuntu8) oneiric; urgency=low

  * Cherry-pick two upstream crash fixes (LP: #375625).
    - 09CHERRY_7cb17d54.dpatch
    - 09CHERRY_45d0c395.dpatch
 -- Kees Cook <email address hidden> Mon, 06 Jun 2011 10:26:45 -0700

Changed in screen (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Matt Wheeler (funkyhat) wrote :

Any chance of getting this backported to 10.04?

Revision history for this message
Malcolm Scott (malcscott) wrote :

Backported packages are available in my PPA: https://launchpad.net/~malcscott/+archive/screen

No warranty, etc.; I've tested the natty backport and it seems to work for me (although since the crash is infrequent here I can't yet 100% confirm that the bug is fixed). Backports for other versions will be available in a few hours and are not tested. Use at your own risk.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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