From owner-freebsd-amd64@FreeBSD.ORG Sat Jan 14 19:10:07 2006 Return-Path: X-Original-To: freebsd-amd64@hub.freebsd.org Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB66516A420 for ; Sat, 14 Jan 2006 19:10:07 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0601A43D5E for ; Sat, 14 Jan 2006 19:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0EJA39r031504 for ; Sat, 14 Jan 2006 19:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0EJA3Cq031503; Sat, 14 Jan 2006 19:10:03 GMT (envelope-from gnats) Resent-Date: Sat, 14 Jan 2006 19:10:03 GMT Resent-Message-Id: <200601141910.k0EJA3Cq031503@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Javier Martín Rueda Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4AA4116A41F for ; Sat, 14 Jan 2006 19:08:52 +0000 (GMT) (envelope-from root@naranja.diatel.upm.es) Received: from naranja.diatel.upm.es (naranja.diatel.upm.es [138.100.49.124]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF41D43D49 for ; Sat, 14 Jan 2006 19:08:51 +0000 (GMT) (envelope-from root@naranja.diatel.upm.es) Received: from naranja.diatel.upm.es (localhost [127.0.0.1]) by naranja.diatel.upm.es (8.13.4/8.13.4) with ESMTP id k0EJ7WtV023655 for ; Sat, 14 Jan 2006 20:07:32 +0100 (CET) (envelope-from root@naranja.diatel.upm.es) Received: (from root@localhost) by naranja.diatel.upm.es (8.13.4/8.13.4/Submit) id k0EJ7WbP023654; Sat, 14 Jan 2006 20:07:32 +0100 (CET) (envelope-from root) Message-Id: <200601141907.k0EJ7WbP023654@naranja.diatel.upm.es> Date: Sat, 14 Jan 2006 20:07:32 +0100 (CET) From: Javier Martín Rueda To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: amd64/91799: ggated core dumps on amd64 after client connection X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Javier Martín Rueda List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2006 19:10:08 -0000 >Number: 91799 >Category: amd64 >Synopsis: ggated core dumps on amd64 after client connection >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 14 19:10:03 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Javier Martín Rueda >Release: FreeBSD 6.0-RELEASE amd64 >Organization: Universidad Politécnica de Madrid >Environment: System: FreeBSD naranja.diatel.upm.es 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Fri Jan 13 14:11:52 CET 2006 root@naranja.diatel.upm.es:/usr/src/sys/amd64/compile/SMP amd64 >Description: On a amd64 system where a GGATE disk has been setup, ggated crashes on the server when the client connects to it. If the server is run with the -v option, the following message appears: Assertion failed: ((req->r_length % conn->c_sectorsize) == 0), function disk_thr ead, file ggated.c, line 714. Incidentally, the client is left in such a state that you'll be forced to do a hard reset, as the ggatec process must block something in the kernel that seems to prevent other disk activity on it, and it is impossible to log into it, ctrl-alt-del, shutdown, etc. >How-To-Repeat: Create a basic ggated config file on the server, like this: 172.16.1.1 RW /dev/da1s1g Start the server executing ggated. Then start the client with ggatec 172.16.1.1 /dev/da1s1g. The ggated process on the server will start core dumping and restarting, unsuccessfully. The client will hang (waiting for the server to service it). Warning: you may leave the client in such a state that a only a hard reset will take it out from it (no ordered shutdown will be possible). >Fix: The problem is that the ggated code uses a data type for the sector size of the device it is serving which is inconsistent with the one used in the kernel by the ioctl that returns the sector size. The incorrect data type happens to work for a 32 bit system, but not for a 64 bit. To correct it, apply the following patch to the source tree and recompile and install ggated: --- src/sbin/ggate/shared/ggate.h.orig Fri Jul 8 23:28:26 2005 +++ src/sbin/ggate/shared/ggate.h Sat Jan 14 19:40:52 2006 @@ -98,7 +98,7 @@ void g_gate_xvlog(const char *message, va_list ap); void g_gate_xlog(const char *message, ...); off_t g_gate_mediasize(int fd); -size_t g_gate_sectorsize(int fd); +u_int g_gate_sectorsize(int fd); void g_gate_open_device(void); void g_gate_close_device(void); void g_gate_ioctl(unsigned long req, void *data); --- src/sbin/ggate/shared/ggate.c.orig Fri Jul 8 23:28:26 2005 +++ src/sbin/ggate/shared/ggate.c Sat Jan 14 19:40:52 2006 @@ -149,10 +149,10 @@ return (mediasize); } -size_t +u_int g_gate_sectorsize(int fd) { - size_t secsize; + u_int secsize; struct stat sb; if (fstat(fd, &sb) == -1) --- src/sbin/ggate/ggated/ggated.c.orig Sun Jul 10 23:10:20 2005 +++ src/sbin/ggate/ggated/ggated.c Sat Jan 14 19:40:29 2006 @@ -60,7 +60,7 @@ struct ggd_connection { off_t c_mediasize; - off_t c_sectorsize; + u_int c_sectorsize; unsigned c_flags; /* flags (RO/RW) */ int c_diskfd; int c_sendfd; >Release-Note: >Audit-Trail: >Unformatted: