From owner-freebsd-current@FreeBSD.ORG Tue Jul 3 20:59:24 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B442116A41F for ; Tue, 3 Jul 2007 20:59:24 +0000 (UTC) (envelope-from caelian@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by mx1.freebsd.org (Postfix) with ESMTP id 7515A13C465 for ; Tue, 3 Jul 2007 20:59:24 +0000 (UTC) (envelope-from caelian@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1151531nzf for ; Tue, 03 Jul 2007 13:59:23 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W7ZswhLdfV9bcr+VmoSETGuCn18fmklD8P1qCKCGRVzvepn7O+DNiaCpkHi4iI/SJGE0FOlnkEFqYUQiXErgn9DCtWrW2IrXjNvLBQaDEb52ZnXUSDJ2lY7NIIbxjD1bUUkl4qCNygf3DA2h4FhlsPkLQbhJz5VyP6aBxXWVO6U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g2mDTW3fJN7jbGkliD/OmedlGx9AggxBBx8NvHuza9J/D2hnqOHE8R5+Ko6Yq/YzH3PKfVNuJKhd+cVlIrl/lmWhpG+OBGKbAJQTi+0OszsF44crEzc0Dlf0/fFNn66uMtr0rw3A72mp4CcSeKA9ZzIQCstp39XeIcEBDOKlXlw= Received: by 10.78.146.11 with SMTP id t11mr3818269hud.1183496362753; Tue, 03 Jul 2007 13:59:22 -0700 (PDT) Received: by 10.78.160.4 with HTTP; Tue, 3 Jul 2007 13:59:22 -0700 (PDT) Message-ID: Date: Tue, 3 Jul 2007 22:59:22 +0200 From: "Pascal Hofstee" To: current In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: Subject: Re: ZFS vs Samba Debugging Results ... Need Help. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2007 20:59:24 -0000 On 7/3/07, Pascal Hofstee wrote: > I include the function implementation in question for convenience here: > > char *vfs_readdirname(connection_struct *conn, void *p) > { > SMB_STRUCT_DIRENT *ptr= NULL; > char *dname; > > if (!p) > return(NULL); > > ptr = SMB_VFS_READDIR(conn, (DIR *)p); > if (!ptr) > return(NULL); > > dname = ptr->d_name; > > #ifdef NEXT2 > if (telldir(p) < 0) > return(NULL); > #endif > > #ifdef HAVE_BROKEN_READDIR_NAME > /* using /usr/ucb/cc is BAD */ > dname = dname - 2; > #endif > > return(dname); > } I hate following up on my own posts especially several minutes after the original. I just realised that i overlooked one detail in my original debugging session which entirely explains what's happening ... Below is a walk-through of my debugging session: Breakpoint 1, vfs_readdirname (conn=0x20a25030, p=0x20a0e000) at smbd/vfs.c:628 628 if (!p) (gdb) next 631 ptr = SMB_VFS_READDIR(conn, (DIR *)p); (gdb) 632 if (!ptr) (gdb) print ptr $3 = (struct dirent *) 0x20a0e014 (gdb) print dname $4 = 0x20a0e014 "\003" (gdb) next 647 return(dname); It looks like somehow gcc optimized out the actual assignment of dname ! With kind regards, -- Pascal Hofstee