bin/124353: cvsup(1): CVSup coredumps with Bus Error since installworld of 6.3-STABLE on 28/5/08 [regression]

Joseph Koshy jkoshy at FreeBSD.org
Mon Aug 18 11:50:04 UTC 2008


The following reply was made to PR bin/124353; it has been noted by GNATS.

From: Joseph Koshy <jkoshy at FreeBSD.org>
To: bug-followup at FreeBSD.org,srp at zzap.org
Cc: pav at 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 <fcntl.h>
 +
  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 ***)


More information about the freebsd-bugs mailing list