Subject: pkg/25317: spurious "No more PTYs" from screen
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <apb@cequrux.com>
List: pkgsrc-bugs
Date: 04/25/2004 20:04:01
>Number:         25317
>Category:       pkg
>Synopsis:       spurious "No more PTYs" from screen
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 25 18:05:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Alan Barrett
>Release:        NetBSD 1.6ZK
>Organization:
Not much
>Environment:
System: NetBSD 1.6ZK
Architecture: i386
Machine: i386
>Description:
	screen-4.0.2 (from pkgsrc/misc/screen) sometimes
	reports "No more PTYs", even though there should
	be plenty of available PTYs, and other applications (including
	other instances of screen) are able to allocate PTYs.

>How-To-Repeat:
        Install screen.  Use it for several hours, opening and closing
        many windows.  I don't knopw exactly what causes the problem,
        and I have been unable to reproduce it on demand, but my normal
        usage pattern always triggers the problem after several hours.

>Fix:
        The patch in pkgsrc/misc/screen/patches/patch-aa seems to apply
        in the wrong place.  It adds a "#if defined(NetBSD)" section
        below the existing "#if defined(HAVE_OPENPTY)" in pty.c.  Moving
        the NetBSD block above the HAVE_OPENPTY block (instead of below
        it) seems to fix the problem (see the appended patch).  But
        perhaps we should just modify the "HAVE_OPENPTY" block without
        adding a NetBSD block?

Index: pkgsrc/misc/screen/patches/patch-aa
===================================================================
--- misc/screen/patches/patch-aa	15 Sep 2002 06:51:37 -0000	1.9
+++ misc/screen/patches/patch-aa	25 Apr 2004 17:41:12 -0000
@@ -1,8 +1,8 @@
 $NetBSD: patch-aa,v 1.9 2002/09/15 06:51:37 kim Exp $
 
---- pty.c.orig	Mon Feb 11 07:44:18 2002
-+++ pty.c	Mon Aug  5 19:58:48 2002
-@@ -318,6 +318,45 @@
+--- pty.c.orig	2003-09-08 16:26:18.000000000 +0200
++++ pty.c
+@@ -313,6 +313,45 @@ char **ttyn;
  
  /***************************************************************/
  
@@ -45,6 +45,6 @@
 +
 +/***************************************************************/
 +
- #ifndef PTY_DONE
+ #if defined(HAVE_OPENPTY) && !defined(PTY_DONE)
+ #define PTY_DONE
  int
- OpenPTY(ttyn)
>Release-Note:
>Audit-Trail:
>Unformatted: