From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 18 11:50:04 2008 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 27D541065673 for ; Mon, 18 Aug 2008 11:50: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 2140A8FC3B for ; Mon, 18 Aug 2008 11:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m7IBo39C087670 for ; Mon, 18 Aug 2008 11:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m7IBo382087669; Mon, 18 Aug 2008 11:50:03 GMT (envelope-from gnats) Date: Mon, 18 Aug 2008 11:50:03 GMT Message-Id: <200808181150.m7IBo382087669@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Joseph Koshy Cc: Subject: Re: bin/124353: cvsup(1): CVSup coredumps with Bus Error since installworld of 6.3-STABLE on 28/5/08 [regression] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joseph Koshy List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2008 11:50:04 -0000 The following reply was made to PR bin/124353; it has been noted by GNATS. From: Joseph Koshy To: bug-followup@FreeBSD.org,srp@zzap.org Cc: pav@freebsd.org Subject: Re: bin/124353: cvsup(1): CVSup coredumps with Bus Error since installworld of 6.3-STABLE on 28/5/08 [regression] Date: Mon, 18 Aug 2008 11:16:00 -0000 On 24-Apr-08 changes needed to support kernel mode NFS locking were MFC'ed to RELENG_6. As part of this change, the semantics of fcntl() were extended. In order to deal with older binaries, the implementation of fcntl() in "lib/libc" was changed from a direct system call to a varargs wrapper: __fcntl_compat(). Binary calling conventions for varargs and ordinary functions differ on the AMD64. In particular callers of varargs functions use the %al register to pass in a 'hidden' value to the callee. So the changes needed to unbreak Modula-3/CVSup are: 1) Augment the M3 definition of 'struct flock' with a new l_sysid field; this should be harmless on older, pre-NFS-kernel-locking systems. 2) Despatch M3's "fcntl" to a C function "ufcntl" that translates between the two calling conventions. The following patch implements the fix. Since it stacks over pav@'s amd64 patch set, it needs to be applied after first running 'make patch' and before a subsequent 'make install'. pav@, maintainer of the CVSup/AMD64 patch set is CC'ed. Koshy --- libs/m3core/src/runtime/FBSD_AMD64/RTHeapDepC.c.orig 2008-08-18 16:13:42.000000000 +0530 +++ libs/m3core/src/runtime/FBSD_AMD64/RTHeapDepC.c 2008-08-18 16:14:20.000000000 +0530 @@ -1,2 +1,13 @@ +#include + void (*RTHeapRep_Fault)(char*); void (*RTCSRC_FinishVM)(); + +/* + * Translate between non-varargs and varargs calling conventions. + */ +int +ufcntl(int fd, int cmd, long arg) +{ + return (fcntl(fd, cmd, arg)); +} --- libs/m3core/src/unix/freebsd-4.amd64/Unix.i3.orig 2008-08-18 16:13:42.000000000 +0530 +++ libs/m3core/src/unix/freebsd-4.amd64/Unix.i3 2008-08-18 16:15:09.000000000 +0530 @@ -147,6 +147,7 @@ l_pid: pid_t := 0; l_type: short; (* see below *) l_whence: short; + l_sysid: int := 0; END; (* ok *) @@ -155,7 +156,7 @@ F_WRLCK = 3; (* Write lock *) F_UNLCK = 2; (* Remove lock(s) *) -<*EXTERNAL*> PROCEDURE fcntl (fd, request: int; arg: long): int; +<*EXTERNAL "ufcntl"*> PROCEDURE fcntl (fd, request: int; arg: long): int; (* ok *) (*** flock - apply or remove an advisory lock on an open file ***)