From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Aug 7 16:20:04 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 258211065677 for ; Sat, 7 Aug 2010 16:20:04 +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 DBD108FC15 for ; Sat, 7 Aug 2010 16:20:03 +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 o77GK3va047147 for ; Sat, 7 Aug 2010 16:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o77GK30V047146; Sat, 7 Aug 2010 16:20:03 GMT (envelope-from gnats) Resent-Date: Sat, 7 Aug 2010 16:20:03 GMT Resent-Message-Id: <201008071620.o77GK30V047146@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, Anonymous Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04A81106564A for ; Sat, 7 Aug 2010 16:17:21 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC458FC1E for ; Sat, 7 Aug 2010 16:17:20 +0000 (UTC) Received: by fxm13 with SMTP id 13so4885284fxm.13 for ; Sat, 07 Aug 2010 09:17:19 -0700 (PDT) Received: by 10.223.124.205 with SMTP id v13mr14346561far.94.1281197839442; Sat, 07 Aug 2010 09:17:19 -0700 (PDT) Received: from localhost (tor-exit.aof.su [216.224.124.124]) by mx.google.com with ESMTPS id w11sm1085333fao.37.2010.08.07.09.17.15 (version=SSLv3 cipher=RC4-MD5); Sat, 07 Aug 2010 09:17:18 -0700 (PDT) Message-Id: <86ocdejt4g.fsf@gmail.com> Date: Sat, 07 Aug 2010 20:16:15 +0400 From: Anonymous To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: ports/149406: [patch] games/connect4: fix amd64 segfault 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: Sat, 07 Aug 2010 16:20:04 -0000 >Number: 149406 >Category: ports >Synopsis: [patch] games/connect4: fix amd64 segfault >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 07 16:20:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Anonymous >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: tested only on amd64 with/without -m32 >Description: http://docs.freebsd.org/cgi/mid.cgi?86k4o3jznm.fsf - attempt to fix amd64 by using `intptr_t' instead of `int' type[1] - silence warninigs about implicit declaration of strcpy/exit - rather than overriding group and mode just switch defaults for INSTALL_(PROGRAM|DATA) - use DATADIR (cosmetic) [1] I have absolutely no clue if it's the right type >How-To-Repeat: >Fix: --- a.diff begins here --- Index: games/connect4/Makefile =================================================================== RCS file: /a/.cvsup/ports/games/connect4/Makefile,v retrieving revision 1.14 diff -u -p -r1.14 Makefile --- games/connect4/Makefile 19 Mar 2004 23:56:42 -0000 1.14 +++ games/connect4/Makefile 7 Aug 2010 16:04:09 -0000 @@ -26,10 +26,18 @@ EXTRACT_AFTER_ARGS= | gunshar NO_WRKSUBDIR= yes MAN6= connect4.6 +SHAREGRP?= games +SHAREMODE?= 664 + +.if !defined(WITHOUT_SETGID) +BINGRP?= games +BINMODE?= 2555 +.endif + do-install: - ${INSTALL_PROGRAM} -m 2755 -o root -g games ${WRKSRC}/c4 ${PREFIX}/bin/connect4 - @${MKDIR} ${PREFIX}/share/connect4 - ${INSTALL_DATA} -m 664 -o root -g games /dev/null ${PREFIX}/share/connect4/scores + ${INSTALL_PROGRAM} ${WRKSRC}/c4 ${PREFIX}/bin/connect4 + ${MKDIR} ${DATADIR} + ${INSTALL_DATA} /dev/null ${DATADIR}/scores ${INSTALL_MAN} ${FILESDIR}/connect4.6 ${MANPREFIX}/man/man6 .include Index: games/connect4/pkg-plist =================================================================== RCS file: /a/.cvsup/ports/games/connect4/pkg-plist,v retrieving revision 1.4 diff -u -p -r1.4 pkg-plist --- games/connect4/pkg-plist 3 Nov 2000 12:50:56 -0000 1.4 +++ games/connect4/pkg-plist 7 Aug 2010 16:12:33 -0000 @@ -1,3 +1,3 @@ bin/connect4 -share/connect4/scores -@dirrm share/connect4 +%%DATADIR%%/scores +@dirrm %%DATADIR%% Index: games/connect4/files/patch-ab =================================================================== RCS file: /a/.cvsup/ports/games/connect4/files/patch-ab,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-ab --- games/connect4/files/patch-ab 4 Jun 1997 03:21:13 -0000 1.1.1.1 +++ games/connect4/files/patch-ab 7 Aug 2010 16:05:03 -0000 @@ -1,8 +1,8 @@ *** c4.c.orig Tue Apr 15 22:06:03 1997 --- c4.c Tue Apr 15 22:16:29 1997 *************** -*** 11,16 **** ---- 11,18 ---- +*** 11,19 **** +--- 11,23 ---- * BITNET: tcjones@WATER.bitnet * Canadian domain: tcjones@dragon.uwaterloo.ca * @@ -11,6 +11,11 @@ */ #include ++ #include ++ #include + #include + #include + #include *************** *** 219,225 **** register char *cp; @@ -47,3 +52,26 @@ fprintf(stderr, "Could not read input line\n"); goodbye(); } +*************** +*** 835,844 **** + char *last, *address; + while( environ[1] != 0 ) ++environ; + last = environ[0] + strlen(environ[0]);/* address of '\0' */ +! last = (char *)((int)last&(~03));/* word boundary */ + *(int *)last = 0; /* clean out last word */ + address = last +3 -strlen(message); +! address = (char *)((int)address&(~03));/* word boundary */ + *(int *)(address-4) = 0; /* clean out word below */ + *(int *)(address-8) = 0; /* clean out word below */ + strcpy( address, message ); +--- 839,848 ---- + char *last, *address; + while( environ[1] != 0 ) ++environ; + last = environ[0] + strlen(environ[0]);/* address of '\0' */ +! last = (char *)((intptr_t)last&(~03));/* word boundary */ + *(int *)last = 0; /* clean out last word */ + address = last +3 -strlen(message); +! address = (char *)((intptr_t)address&(~03));/* word boundary */ + *(int *)(address-4) = 0; /* clean out word below */ + *(int *)(address-8) = 0; /* clean out word below */ + strcpy( address, message ); --- a.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: