From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 1 00:20:13 2012 Return-Path: Delivered-To: freebsd-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 B32B41065704 for ; Sun, 1 Apr 2012 00:20:13 +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 71E058FC1E for ; Sun, 1 Apr 2012 00:20:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q310KC5J044609 for ; Sun, 1 Apr 2012 00:20:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q310KCIV044608; Sun, 1 Apr 2012 00:20:12 GMT (envelope-from gnats) Resent-Date: Sun, 1 Apr 2012 00:20:12 GMT Resent-Message-Id: <201204010020.q310KCIV044608@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gary Palmer Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D8C9106566B for ; Sun, 1 Apr 2012 00:14:46 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id ECA7D8FC0A for ; Sun, 1 Apr 2012 00:14:45 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q310EjFu031238 for ; Sun, 1 Apr 2012 00:14:45 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q310EjgF031237; Sun, 1 Apr 2012 00:14:45 GMT (envelope-from nobody) Message-Id: <201204010014.q310EjgF031237@red.freebsd.org> Date: Sun, 1 Apr 2012 00:14:45 GMT From: Gary Palmer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/166548: Mismatch in ifdefs can cause problems for /sys/kern/sysv_shm.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2012 00:20:13 -0000 >Number: 166548 >Category: kern >Synopsis: Mismatch in ifdefs can cause problems for /sys/kern/sysv_shm.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Apr 01 00:20:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Gary Palmer >Release: FreeBSD 8.3-RC2 >Organization: >Environment: >Description: While upgrading an old 7.x kern config file to 8.x I stumbled across a problem where if you leave COMPAT_43 in your config file without one of COMPAT_FREEBSD4 through COMPAT_FREEBSD7 the compile breaks. The problem comes from /sys/sys/ipc.h where ipc_perm_old is only defined if one of #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) is true. However in /sys/kern/sysv_shm.c the code has #if defined(__i386__) && (defined(COMPAT_FREEBSD4) || defined(COMPAT_43)) struct oshmid_ds { struct ipc_perm_old shm_perm; /* operation perms */ So if you put COMPAT_43 in your config file and leave out one of the COMPAT_FREEBSD options ipc_perm_old isn't defined. It seems that COMPAT_43 should probably be added to the ifdef conditionals in /sys/sys/ipc.h >How-To-Repeat: Remove options COMPAT_FREEBSD4 options COMPAT_FREEBSD5 options COMPAT_FREEBSD6 options COMPAT_FREEBSD7 from a kernel config file on i386 but leave options COMPAT_43 in >Fix: Untested, but I suspect modifying the code at line 72 of /sys/sys/ipc.h would fix it. Something like: #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) || defined(COMPAT_43) >Release-Note: >Audit-Trail: >Unformatted: