RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1253697 - Cannot reattach to screen sessions
Summary: Cannot reattach to screen sessions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: screen
Version: 7.1
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: rc
: ---
Assignee: Petr Hracek
QA Contact: Jan Kepler
URL:
Whiteboard:
: 1315336 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-14 13:20 UTC by Jason Bradley Nance
Modified: 2019-08-15 05:07 UTC (History)
13 users (show)

Fixed In Version: screen-4.1.0-0.22.20120314git3c2946.el7
Doc Type: Bug Fix
Doc Text:
Previously, when the user tried to reattach an existing screen session after updating the screen packages, the screen utility became unresponsive. With this update, the problem has been fixed and the reattachment of existing sessions works.
Clone Of:
: 1271131 (view as bug list)
Environment:
Last Closed: 2015-11-04 17:32:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
strace output from screen -r (306.13 KB, text/plain)
2015-08-14 13:20 UTC, Jason Bradley Nance
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1988 0 normal SHIPPED_LIVE screen bug fix update 2015-11-04 22:31:58 UTC

Description Jason Bradley Nance 2015-08-14 13:20:51 UTC
Created attachment 1063031 [details]
strace output from screen -r

Description of problem:
screen -r
<indefinite hang, session never appears>

Version-Release number of selected component (if applicable):
4.1.0-0.21.20120314git3c2946.el7  (fasttrack)

How reproducible:
100%

Steps to Reproduce:
1. screen -S foo
2. <detach>
3. yum update screen (with fasttrack enabled)
4. screen -r foo

Actual results:
indefinite hang, session never appears

Expected results:
reattach to detached session

Additional info:
Running this with "strace" gives different results:

$ strace -o screen.trace screen -r foo
Directory '/var/run/screen' must have mode 777.

(full strace attached)

However, if I chmod 777 /var/run screen I get:

$ screen -r foo
Directory '/var/run/screen' must have mode 775.

Comment 2 Al Heisner 2015-08-19 18:10:09 UTC
I was able to reproduce this problem as well. 
You can still connect to the apparently hung screen sessions by using screen binary that was installed before the update was applied.

Comment 4 Petr Hracek 2015-09-01 09:39:38 UTC
I have reported the problem to upstream https://lists.gnu.org/archive/html/screen-devel/2015-08/msg00015.html
and gave a response that your /dev/pts is probably wrongly mounted.

Could you please clarify it?

Comment 5 Jason Bradley Nance 2015-09-01 15:10:33 UTC
Are you unable to reproduce this issue with the information provided?

Here is my /dev/pts mount:

$ mount | grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)

Comment 6 Petr Hracek 2015-09-08 10:09:50 UTC
I have already sent the information to upstream.
Please take a while. I will inform you about progress.

What about ptmxmode? Could it be relevant?

Comment 7 Petr Hracek 2015-09-11 07:27:45 UTC
It seems that source tarball of screen is from some snapshots.
Nowadays upstream again fixes bugs and I suggest to include at least screen-4.1.0 version or even the latest screen-4.3.1.

Comment 9 Petr Hracek 2015-10-01 14:47:45 UTC
Do you know what was the previous version installed on the system?

I would like to make a diff and send it out to upstream.

Comment 16 Chris Cheney 2015-10-09 15:23:46 UTC
Is attaching to an old screen session by a newer version of screen even supposed to be supported? I ran strace against the old detached version and it looked like it saw the connect message and then ignored it, possibly due to being mismatched version.

24976 10:12:13.946549 accept(4, {sa_family=AF_LOCAL, NULL}, [2]) = 3 <0.000045>
24976 10:12:13.946666 recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\x02\x67\x73\x6d\x02\x00\x00\x00\x2f\x64\x65\x76\x2f\x70\x74\x73\x2f\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"..., 12348}], msg_controllen=24, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {8}}, msg_flags=0}, 0) = 12348 <0.000384>
24976 10:12:13.947168 close(3<socket:[276833]>) = 0 <0.000021>
24976 10:12:13.947238 select(1024, [4<socket:[54026]> 6</dev/ptmx>], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler) <24.998173>

Comment 28 Petr Hracek 2015-10-13 13:34:27 UTC
Well, in screen source is mentioned:
http://git.savannah.gnu.org/cgit/screen.git/tree/src/os.h?h=screen-v4#n524
~~~
/* Changing those you won't be able to attach to your old sessions
 * when changing those values in official tree don't forget to bump
 * MSG_VERSION */
#define MAXTERMLEN	32
#define MAXLOGINLEN	256
~~~

And we change it to 50.

Comment 29 Petr Hracek 2015-10-13 15:24:30 UTC
Thanks to upstream debian has a some hack how to attach to the older versions.

I will test it.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=644788;msg=265;att=0

~~~
Discussion with upstream maintainer:
Because of we change the struct msg (by BZ https://bugzilla.redhat.com/show_bug.cgi?id=1119794) which is used for communication reattaching to the previous section is not supported at all. And it is not planned.
~~~~
It was not mentioned in DocText field in FAST Track.

The patch used by debian is not officially supported by upstream and it is not planned.

Comment 42 errata-xmlrpc 2015-11-04 17:32:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1988.html

Comment 47 Josef Ridky 2017-02-07 12:54:27 UTC
*** Bug 1315336 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.