From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jun 30 11:20:08 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F27D71065673 for ; Wed, 30 Jun 2010 11:20:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D2C7D8FC16 for ; Wed, 30 Jun 2010 11:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o5UBK7SP032263 for ; Wed, 30 Jun 2010 11:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o5UBK7UC032260; Wed, 30 Jun 2010 11:20:07 GMT (envelope-from gnats) Resent-Date: Wed, 30 Jun 2010 11:20:07 GMT Resent-Message-Id: <201006301120.o5UBK7UC032260@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bernhard Froehlich Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AF3C106566B for ; Wed, 30 Jun 2010 11:14:12 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from mail.itac.at (mail.itac.at [91.205.172.9]) by mx1.freebsd.org (Postfix) with ESMTP id C214F8FC15 for ; Wed, 30 Jun 2010 11:14:11 +0000 (UTC) Received: from [78.142.74.81] (helo=localhost) by mail.itac.at with esmtpa (Exim 4.63) (envelope-from ) id 1OTvF3-0004gp-V4; Wed, 30 Jun 2010 13:14:10 +0200 Message-Id: <20100630131326.3b423645@FreeBSD.org> Date: Wed, 30 Jun 2010 13:13:26 +0200 From: Bernhard Froehlich To: FreeBSD-gnats-submit@FreeBSD.org Cc: henry.hu.sh@gmail.com Subject: ports/148258: [PATCH] x11/slim: Fix crash on SIGTERM X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2010 11:20:08 -0000 >Number: 148258 >Category: ports >Synopsis: [PATCH] x11/slim: Fix crash on SIGTERM >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 30 11:20:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Bernhard Froehlich >Release: FreeBSD 8.1-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD chii.bluelife.at 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #2: Fri May 28 19:07:40 CEST 2010 >Description: This patch is taken from upstream repository as r169. It fixes the issue that slim coredumps on shutdown when receiving SIGTERM. Added file(s): - files/patch-002-fix-shutdown Port maintainer (henry.hu.sh@gmail.com) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- slim-1.3.1_8.patch begins here --- diff -ruN --exclude=CVS --exclude=.svn /usr/ports/x11/slim.orig/files/patch-002-fix-shutdown /usr/ports/x11/slim/files/patch-002-fix-shutdown --- /usr/ports/x11/slim.orig/files/patch-002-fix-shutdown 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/x11/slim/files/patch-002-fix-shutdown 2010-06-30 13:00:58.000000000 +0200 @@ -0,0 +1,65 @@ +------------------------------------------------------------------------ +r169 | iwamatsu | 2009-11-14 09:13:57 +0100 (Sat, 14 Nov 2009) | 11 lines + +Add flag of server check + +Slim gets this SIGTERM, and its signal handler calls +CloseServer() to teardown X. But X is not yet started (as StartServer() +is still running in another thread, waiting in pause()), and hence this +calls XcloseDisplay which frees some resources which are not yet allocated. + +This parch fix this problem. +Thanks, Landry Breuil, goebbels, jasper and OpenBSD Developer. + +Signed-off-by: Nobuhiro Iwamatsu +------------------------------------------------------------------------ +--- app.h (revision 168) ++++ app.h (revision 169) +@@ -36,6 +36,7 @@ + int GetServerPID(); + void StopServer(); + ++ bool serverStarted; + // Lock functions + void GetLock(); + void RemoveLock(); +--- app.cpp (revision 168) ++++ app.cpp (revision 169) +@@ -105,7 +105,10 @@ + + void CatchSignal(int sig) { + cerr << APPNAME << ": unexpected signal " << sig << endl; +- LoginApp->StopServer(); ++ ++ if (LoginApp->serverStarted) ++ LoginApp->StopServer(); ++ + LoginApp->RemoveLock(); + exit(ERR_EXIT); + } +@@ -140,6 +143,7 @@ + int tmp; + ServerPID = -1; + testing = false; ++ serverStarted = false; + mcookie = string(App::mcookiesize, 'a'); + daemonmode = false; + force_nodaemon = false; +@@ -860,6 +864,8 @@ + char* args = new char[argOption.length()+2]; // NULL plus vt + strcpy(args, argOption.c_str()); + ++ serverStarted = false; ++ + int argc = 1; + int pos = 0; + bool hasVtSet = false; +@@ -940,6 +946,8 @@ + + delete args; + ++ serverStarted = true; ++ + return ServerPID; + } + --- slim-1.3.1_8.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: