From owner-freebsd-current@FreeBSD.ORG Thu Nov 18 16:43:59 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DB3016A4CE for ; Thu, 18 Nov 2004 16:43:59 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 359D343D5C for ; Thu, 18 Nov 2004 16:43:58 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])iAIGhuAU012471 for ; Thu, 18 Nov 2004 18:43:56 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) iAIGhuS3046268 for ; Thu, 18 Nov 2004 18:43:56 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)iAIGhurH046267 for freebsd-current@freebsd.org; Thu, 18 Nov 2004 18:43:56 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Thu, 18 Nov 2004 18:43:56 +0200 From: Giorgos Keramidas To: freebsd-current@freebsd.org Message-ID: <20041118164356.GA46185@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: bug of misc/screen and fifos or ours? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2004 16:43:59 -0000 The screen-4.0.2 version that misc/screen installs is apparently the latest version of screen available. It also contains a zillion bugs, is written in a very insecure style, it uses an antiquated version of autoconf script, etc. I'm in the process of fixing some of these bugs, and mailing them back to the screen maintainers (if they still work on screen at all, that is). This post is just the description of a workaround for a recent breakage I noticed. When screen runs under xterm/X11 in recent FreeBSD 6.0-CURRENT versions, resizing the containing xterm results in an immediate panic with: BLOCK fcntl This is apparently the result of the following code from screen/socket.c: 793 #ifdef NAMEDPIPE 794 debug("Ha, there was someone knocking on my fifo??\n"); 795 if (fcntl(ServerSocket, F_SETFL, 0) == -1) 796 Panic(errno, "BLOCK fcntl"); 797 #else 798 struct sockaddr_un a; 799 800 len = sizeof(a); 801 debug("Ha, there was someone knocking on my socket??\n"); 802 if ((ns = accept(ns, (struct sockaddr *) &a, &len)) < 0) 803 { 804 Msg(errno, "accept"); 805 return; 806 } 807 #endif /* NAMEDPIPE */ At line 795, screen attempts to set blocking mode on a FIFO and fails. I've added the following patch in my local ports tree and tested screen(1) with (effectively forced) UNIX domain sockets instead of FIFOs: % --- config.h.in.orig Thu Nov 18 18:14:02 2004 % +++ config.h.in Thu Nov 18 18:14:12 2004 % @@ -526,11 +526,6 @@ % #undef SELECT_BROKEN % % /* % - * Define this if your system supports named pipes. % - */ % -#undef NAMEDPIPE % - % -/* % * Define this if your system exits select() immediatly if a pipe is % * opened read-only and no writer has opened it. % */ This seems to have solved the crashes I was seeing. But is this correct? Is fcntl() really supposed to fail on FIFOs or is this a FreeBSD bug? - Giorgos