From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 18:40:00 2010 Received: (at submit) by debbugs.gnu.org; 1 Jul 2010 22:40:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSQK-0006Sn-LI for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:40:00 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSQI-0006Sf-QN for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:39:59 -0400 Received: from lists.gnu.org ([199.232.76.165]:46658) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OUSQE-0000Fc-Kp for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:39:54 -0400 Received: from [140.186.70.92] (port=39811 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUSQ8-0005Xv-Um for bug-coreutils@gnu.org; Thu, 01 Jul 2010 18:39:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUSQ3-0008WL-PX for bug-coreutils@gnu.org; Thu, 01 Jul 2010 18:39:48 -0400 Received: from kiwi.cs.ucla.edu ([131.179.128.19]:42182) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSQ3-0008W1-Bj; Thu, 01 Jul 2010 18:39:43 -0400 Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by kiwi.cs.ucla.edu (8.13.8+Sun/8.13.8/UCLACS-6.0) with ESMTP id o61MdWQP029382; Thu, 1 Jul 2010 15:39:32 -0700 (PDT) Message-ID: <4C2D1924.1040909@cs.ucla.edu> Date: Thu, 01 Jul 2010 15:39:32 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jim Meyering Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys References: <87oceqnbl2.fsf@meyering.net> In-Reply-To: <87oceqnbl2.fsf@meyering.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org, bug-gnulib@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) Re the patch you just reported in: I assume this is to support the du performance improvement that was proposed in . I see that you incorporated a further improvement in the gnulib patch, namely, support for NULL keys. The gnulib change seems fine, but I noticed some problems with the coreutils part of that earlier proposal. Among other things, it makes du dump core on a (large) test case that I have locally. I don't know why (perhaps there were further fixes to the gnulib part that I didn't get right?). I found out about the core dump only because I had independently prepared a patch that I think is better: it uses a bit less memory and is quite a bit simpler. I'll try to merge my patch with your gnulib change and send it off to bug-coreutils in the next day or two. My patch, by the way, doesn't hash pointer keys: it just uses size_t values and casts them to void * (which is what the hash package wants). This trick works on all architectures that I know about, but it isn't guaranteed by C or POSIX and the casts are a bit offputting, so it'd be nice if the hash package supported hashing size_t keys directly. That's lower priority, though. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 18:59:35 2010 Received: (at submit) by debbugs.gnu.org; 1 Jul 2010 22:59:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSjG-0006dh-Q7 for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:59:35 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSjF-0006dQ-2w for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:59:33 -0400 Received: from lists.gnu.org ([199.232.76.165]:43260) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OUSjB-0000dE-95 for submit@debbugs.gnu.org; Thu, 01 Jul 2010 18:59:29 -0400 Received: from [140.186.70.92] (port=48284 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUSj5-00062k-3e for bug-coreutils@gnu.org; Thu, 01 Jul 2010 18:59:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUSiz-00028M-Vz for bug-coreutils@gnu.org; Thu, 01 Jul 2010 18:59:22 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:36403) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUSiz-000268-B3; Thu, 01 Jul 2010 18:59:17 -0400 Received: from mx.meyering.net (unknown [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 69BD194000A; Fri, 2 Jul 2010 00:59:10 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 2F2F6E4A1; Fri, 2 Jul 2010 00:59:09 +0200 (CEST) From: Jim Meyering To: Paul Eggert Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys In-Reply-To: <4C2D1924.1040909@cs.ucla.edu> (Paul Eggert's message of "Thu, 01 Jul 2010 15:39:32 -0700") References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> Date: Fri, 02 Jul 2010 00:59:09 +0200 Message-ID: <878w5un70i.fsf@meyering.net> Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org, bug-gnulib@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Paul Eggert wrote: > Re the patch you just reported in: > > > I assume this is to support the du performance improvement that was proposed in > . Right. That's the same as this: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/20857 > I see that you incorporated a further > improvement in the gnulib patch, namely, support for NULL keys. > > The gnulib change seems fine, but I noticed some problems with the coreutils > part of that earlier proposal. Among other things, it makes du dump core on a > (large) test case that I have locally. I don't know why (perhaps there > were further fixes to the gnulib part that I didn't get right?). I found Thanks for testing those. Can you give me a backtrace? Even if your patch is clearly better, I'd like to know how my code is malfunctioning. > out about the core dump only because I had independently prepared a patch > that I think is better: it uses a bit less memory and is quite a bit simpler. > I'll try to merge my patch with your gnulib change and send it off to > bug-coreutils in the next day or two. > > My patch, by the way, doesn't hash pointer keys: it just uses size_t values > and casts them to void * (which is what the hash package wants). This trick > works on all architectures that I know about, but it isn't guaranteed by > C or POSIX and the casts are a bit offputting, Using unions is one way to avoid casts (and certain warnings). > so it'd be nice if the hash > package supported hashing size_t keys directly. That's lower priority, though. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 20:07:18 2010 Received: (at submit) by debbugs.gnu.org; 2 Jul 2010 00:07:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUTmo-0007eN-Au for submit@debbugs.gnu.org; Thu, 01 Jul 2010 20:07:18 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUTmm-0007eG-FD for submit@debbugs.gnu.org; Thu, 01 Jul 2010 20:07:17 -0400 Received: from lists.gnu.org ([199.232.76.165]:40114) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OUTmi-0001VV-LK for submit@debbugs.gnu.org; Thu, 01 Jul 2010 20:07:12 -0400 Received: from [140.186.70.92] (port=39156 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUTmh-0005Oo-E3 for bug-coreutils@gnu.org; Thu, 01 Jul 2010 20:07:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUTmg-0002Z3-4V for bug-coreutils@gnu.org; Thu, 01 Jul 2010 20:07:11 -0400 Received: from kiwi.cs.ucla.edu ([131.179.128.19]:42552) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUTmf-0002Yx-SC; Thu, 01 Jul 2010 20:07:10 -0400 Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by kiwi.cs.ucla.edu (8.13.8+Sun/8.13.8/UCLACS-6.0) with ESMTP id o62070Zu000120; Thu, 1 Jul 2010 17:07:01 -0700 (PDT) Message-ID: <4C2D2DA4.7040203@cs.ucla.edu> Date: Thu, 01 Jul 2010 17:07:00 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jim Meyering Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> <878w5un70i.fsf@meyering.net> In-Reply-To: <878w5un70i.fsf@meyering.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org, bug-gnulib@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) On 07/01/10 15:59, Jim Meyering wrote: > Can you give me a backtrace? > Even if your patch is clearly better, I'd like to know > how my code is malfunctioning. Sure. This uses your older patch, not the newer gnulib one. Program received signal SIGABRT, Aborted. 0x0012d422 in __kernel_vsyscall () (gdb) where #0 0x0012d422 in __kernel_vsyscall () #1 0x00158651 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #2 0x0015ba82 in *__GI_abort () at abort.c:92 #3 0x08054826 in hash_insert0 (table=0x805f208, entry=0x8017384d, matched_ent=0x0) at hash.c:1078 #4 0x0804bdba in di_set_insert (dis=0x805e2f4, dev=2049, ino=380435) at di-set.c:264 #5 0x0804ab0f in hash_ins (argc=52, argv=0xbffff304) at du.c:335 #6 process_file (argc=52, argv=0xbffff304) at du.c:467 #7 du_files (argc=52, argv=0xbffff304) at du.c:592 #8 main (argc=52, argv=0xbffff304) at du.c:962 The test case, by the way, is "./du ../../cu*", where the globbing pattern expands to 51 directories, each a copy of coreutils, with several hard links because many are git clones of each other. Arf arf! (I'm eating my own dog food.) > Using unions is one way to avoid casts (and certain warnings). Yes; but ouch! That's jumping into the fire! I suspect it's even less likely to work on weird architectures. I'd rather stay in the frying pan. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 06:59:10 2010 Received: (at submit) by debbugs.gnu.org; 2 Jul 2010 10:59:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUdxd-0003C1-OT for submit@debbugs.gnu.org; Fri, 02 Jul 2010 06:59:09 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUdxc-0003Bm-HT for submit@debbugs.gnu.org; Fri, 02 Jul 2010 06:59:08 -0400 Received: from lists.gnu.org ([199.232.76.165]:57207) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OUdxX-0001bI-CN for submit@debbugs.gnu.org; Fri, 02 Jul 2010 06:59:03 -0400 Received: from [140.186.70.92] (port=43269 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUdxV-0007dk-KR for bug-coreutils@gnu.org; Fri, 02 Jul 2010 06:59:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUdxU-0004mX-EN for bug-coreutils@gnu.org; Fri, 02 Jul 2010 06:59:01 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:57387) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUdxT-0004lx-QA; Fri, 02 Jul 2010 06:59:00 -0400 Received: from mx.meyering.net (unknown [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 0C8C894010F; Fri, 2 Jul 2010 12:58:51 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 8DF34BCA; Fri, 2 Jul 2010 12:58:50 +0200 (CEST) From: Jim Meyering To: Paul Eggert Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys In-Reply-To: <4C2D2DA4.7040203@cs.ucla.edu> (Paul Eggert's message of "Thu, 01 Jul 2010 17:07:00 -0700") References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> <878w5un70i.fsf@meyering.net> <4C2D2DA4.7040203@cs.ucla.edu> Date: Fri, 02 Jul 2010 12:58:50 +0200 Message-ID: <87oceqi1zp.fsf@meyering.net> Lines: 54 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit Cc: bug-gnulib@gnu.org, bug-coreutils@gnu.org, =?utf-8?Q?P=C3=A1draig?= Brady , 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Paul Eggert wrote: > On 07/01/10 15:59, Jim Meyering wrote: > >> Can you give me a backtrace? >> Even if your patch is clearly better, I'd like to know >> how my code is malfunctioning. > > Sure. This uses your older patch, not the newer gnulib one. I think they're functionally equivalent. The new one adds comments. > Program received signal SIGABRT, Aborted. > 0x0012d422 in __kernel_vsyscall () > (gdb) where > #0 0x0012d422 in __kernel_vsyscall () > #1 0x00158651 in *__GI_raise (sig=3D6) at ../nptl/sysdeps/unix/sysv/linu= x/raise.c:64 > #2 0x0015ba82 in *__GI_abort () at abort.c:92 > #3 0x08054826 in hash_insert0 (table=3D0x805f208, entry=3D0x8017384d, ma= tched_ent=3D0x0) at hash.c:1078 > #4 0x0804bdba in di_set_insert (dis=3D0x805e2f4, dev=3D2049, ino=3D38043= 5) at di-set.c:264 > #5 0x0804ab0f in hash_ins (argc=3D52, argv=3D0xbffff304) at du.c:335 > #6 process_file (argc=3D52, argv=3D0xbffff304) at du.c:467 > #7 du_files (argc=3D52, argv=3D0xbffff304) at du.c:592 > #8 main (argc=3D52, argv=3D0xbffff304) at du.c:962 > > The test case, by the way, is "./du ../../cu*", where the > globbing pattern expands to 51 directories, each a copy of coreutils, > with several hard links because many are git clones of each other. Ouch. That's the same assertion that P=C3=A1draig hit. But he was subsequently unable to reproduce it. It indicates that when attempting to insert the 2049,380435 dev,inode pair, hash_insert0 found that the pair was not yet in the table, and that the table was too full, so it first rehashed everything into a larger table, and then asserted this: Since ENTRY was not in the initial table, it had better not be in the rehashed table. That assertion failed, because somehow, ENTRY *was* in the new table. Knowing the initial table size and the new one, given the above, we might be able to determine what went wrong. I have tried numerous times on both x86_64 and i686 to reproduce it, but have never managed to trigger the failure. Can you run "print *table" in gdb, say in hash_insert0? Better still, set a conditional breakpoint in hash_insert0 to trigger when ENTRY =3D=3D 0x8017384d (encoded version of 2049,380435), and print the entire table using a variant of hash_print, step past the rehash, and print the new table. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 15:17:38 2010 Received: (at submit) by debbugs.gnu.org; 2 Jul 2010 19:17:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUlk1-0007hC-Vw for submit@debbugs.gnu.org; Fri, 02 Jul 2010 15:17:38 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUlk0-0007gw-Fr for submit@debbugs.gnu.org; Fri, 02 Jul 2010 15:17:37 -0400 Received: from lists.gnu.org ([199.232.76.165]:44795) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OUljw-0002Gf-4r for submit@debbugs.gnu.org; Fri, 02 Jul 2010 15:17:32 -0400 Received: from [140.186.70.92] (port=49426 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUlju-0005lC-Ox for bug-coreutils@gnu.org; Fri, 02 Jul 2010 15:17:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUljt-0007DP-G0 for bug-coreutils@gnu.org; Fri, 02 Jul 2010 15:17:30 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:44844) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUljs-0007DA-RL; Fri, 02 Jul 2010 15:17:29 -0400 Received: from mx.meyering.net (unknown [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id A39A8940045; Fri, 2 Jul 2010 21:17:21 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 586C9E1D; Fri, 2 Jul 2010 21:17:20 +0200 (CEST) From: Jim Meyering To: Paul Eggert Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys In-Reply-To: <4C2D2DA4.7040203@cs.ucla.edu> (Paul Eggert's message of "Thu, 01 Jul 2010 17:07:00 -0700") References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> <878w5un70i.fsf@meyering.net> <4C2D2DA4.7040203@cs.ucla.edu> Date: Fri, 02 Jul 2010 21:17:20 +0200 Message-ID: <87bpapg0cf.fsf@meyering.net> Lines: 86 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org, bug-gnulib@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Paul Eggert wrote: > On 07/01/10 15:59, Jim Meyering wrote: > >> Can you give me a backtrace? >> Even if your patch is clearly better, I'd like to know >> how my code is malfunctioning. > > Sure. This uses your older patch, not the newer gnulib one. > > Program received signal SIGABRT, Aborted. > 0x0012d422 in __kernel_vsyscall () > (gdb) where > #0 0x0012d422 in __kernel_vsyscall () > #1 0x00158651 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > #2 0x0015ba82 in *__GI_abort () at abort.c:92 > #3 0x08054826 in hash_insert0 (table=0x805f208, entry=0x8017384d, matched_ent=0x0) at hash.c:1078 > #4 0x0804bdba in di_set_insert (dis=0x805e2f4, dev=2049, ino=380435) at di-set.c:264 > #5 0x0804ab0f in hash_ins (argc=52, argv=0xbffff304) at du.c:335 > #6 process_file (argc=52, argv=0xbffff304) at du.c:467 > #7 du_files (argc=52, argv=0xbffff304) at du.c:592 > #8 main (argc=52, argv=0xbffff304) at du.c:962 > > The test case, by the way, is "./du ../../cu*", where the > globbing pattern expands to 51 directories, each a copy of coreutils, > with several hard links because many are git clones of each other. > Arf arf! (I'm eating my own dog food.) Thanks again for the report. However, while I was able to reproduce it (on Paul's system) and debug it, it appears to be due to a miscompilation of di-set.o when using a private copy of gcc-4.5.0. When I recompiled that one file with gcc-Ubuntu 4.4.3-4ubuntu5 and -g -O2 or with 4.5.0 and -g -O, the code works as expected. The problem arose in the di_ent_compare function and its use of the tiny decode_ptr. For the record, here they are: static struct di_ent decode_ptr (struct di_ent const *v) { if (!is_encoded_ptr (v)) return *v; struct di_ent di; di.u.ptr = (void *) v; return di; } /* Compare two di_ent structs. Return true if they are the same. */ static bool di_ent_compare (void const *x, void const *y) { struct di_ent a = decode_ptr (x); struct di_ent b = decode_ptr (y); if (a.u.di4.mode != b.u.di4.mode) return false; if (a.u.di4.mode == DI_MODE_4) return (a.u.di4.short_ino == b.u.di4.short_ino && a.u.di4.mapped_dev == b.u.di4.mapped_dev); if (a.u.di8.mode == DI_MODE_8) return (a.u.di8.short_ino == b.u.di8.short_ino && a.u.di8.mapped_dev == b.u.di8.mapped_dev); return (a.u.full.ino == b.u.full.ino && a.u.full.dev == b.u.full.dev); } Even though they're obviously distinct encoded values (see the hexadecimal values below), di_ent_compare (aka table->comparator) reports they're equal when using gcc-4.5.0 -g -O2, and that causes the failed assertion: (gdb) p table->comparator (entry, bucket->data) $9 = true (gdb) p bucket->data $10 = (void *) 0x80143c4d (gdb) p entry $11 = (const void *) 0x80173851 I expect to push this series shortly. Paul, if you end up improving further, you're welcome to revert any pieces that are no longer used. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 18:44:18 2010 Received: (at submit) by debbugs.gnu.org; 4 Jul 2010 22:44:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVXv7-00048b-Sc for submit@debbugs.gnu.org; Sun, 04 Jul 2010 18:44:18 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVXv5-00048P-QI for submit@debbugs.gnu.org; Sun, 04 Jul 2010 18:44:16 -0400 Received: from lists.gnu.org ([199.232.76.165]:49322) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OVXv1-0003jC-SJ for submit@debbugs.gnu.org; Sun, 04 Jul 2010 18:44:11 -0400 Received: from [140.186.70.92] (port=41359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVXv0-0006C5-Db for bug-coreutils@gnu.org; Sun, 04 Jul 2010 18:44:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVXux-0001QZ-Ve for bug-coreutils@gnu.org; Sun, 04 Jul 2010 18:44:10 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:7145) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OVXux-0001Pw-Gu for bug-coreutils@gnu.org; Sun, 04 Jul 2010 18:44:07 -0400 Received: (qmail 85430 invoked from network); 4 Jul 2010 22:44:04 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 4 Jul 2010 22:44:04 -0000 Message-ID: <4C310E95.2040504@draigBrady.com> Date: Sun, 04 Jul 2010 23:43:33 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Jim Meyering Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> <878w5un70i.fsf@meyering.net> <4C2D2DA4.7040203@cs.ucla.edu> <87bpapg0cf.fsf@meyering.net> In-Reply-To: <87bpapg0cf.fsf@meyering.net> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit Cc: bug-gnulib@gnu.org, Paul Eggert , bug-coreutils@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) On 02/07/10 20:17, Jim Meyering wrote: > Thanks again for the report. > However, while I was able to reproduce it (on Paul's system) > and debug it, it appears to be due to a miscompilation of di-set.o > when using a private copy of gcc-4.5.0. When I recompiled > that one file with gcc-Ubuntu 4.4.3-4ubuntu5 and -g -O2 > or with 4.5.0 and -g -O, the code works as expected. I used a private gcc 4.5.0 also, and switched to gcc 4.4.1 for debugging where I couldn't reproduce it (gcc 4.5.0 produces debugging info with incompatible line number info for my gdb (6.8.50)). I had used gcc 4.5.0 to test -Wlogical-op with coreutils which was also buggy unfortunately: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772 I'll not be using that again. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 01:29:43 2010 Received: (at submit) by debbugs.gnu.org; 5 Jul 2010 05:29:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVeFT-0007JH-0S for submit@debbugs.gnu.org; Mon, 05 Jul 2010 01:29:43 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVeFR-0007J1-KD for submit@debbugs.gnu.org; Mon, 05 Jul 2010 01:29:42 -0400 Received: from lists.gnu.org ([199.232.76.165]:47267) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OVeFO-0007wZ-CT for submit@debbugs.gnu.org; Mon, 05 Jul 2010 01:29:38 -0400 Received: from [140.186.70.92] (port=34737 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVeFM-0003U4-Ff for bug-coreutils@gnu.org; Mon, 05 Jul 2010 01:29:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVeFL-0004sR-IW for bug-coreutils@gnu.org; Mon, 05 Jul 2010 01:29:36 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:34826) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVeFK-0004rv-TJ; Mon, 05 Jul 2010 01:29:35 -0400 Received: from mx.meyering.net (unknown [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 4E2079400F2; Mon, 5 Jul 2010 07:29:27 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id C4F2AE2AF; Mon, 5 Jul 2010 07:29:26 +0200 (CEST) From: Jim Meyering To: =?utf-8?Q?P=C3=A1draig?= Brady Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys In-Reply-To: <4C310E95.2040504@draigBrady.com> (=?utf-8?Q?=22P=C3=A1draig?= Brady"'s message of "Sun, 04 Jul 2010 23:43:33 +0100") References: <87oceqnbl2.fsf@meyering.net> <4C2D1924.1040909@cs.ucla.edu> <878w5un70i.fsf@meyering.net> <4C2D2DA4.7040203@cs.ucla.edu> <87bpapg0cf.fsf@meyering.net> <4C310E95.2040504@draigBrady.com> Date: Mon, 05 Jul 2010 07:29:26 +0200 Message-ID: <878w5q339l.fsf@meyering.net> Lines: 18 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org, Paul Eggert , bug-gnulib@gnu.org, 6524@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) P=C3=A1draig Brady wrote: > On 02/07/10 20:17, Jim Meyering wrote: >> Thanks again for the report. >> However, while I was able to reproduce it (on Paul's system) >> and debug it, it appears to be due to a miscompilation of di-set.o >> when using a private copy of gcc-4.5.0. When I recompiled >> that one file with gcc-Ubuntu 4.4.3-4ubuntu5 and -g -O2 >> or with 4.5.0 and -g -O, the code works as expected. > > I used a private gcc 4.5.0 also, and switched to > gcc 4.4.1 for debugging where I couldn't reproduce it > (gcc 4.5.0 produces debugging info with incompatible > line number info for my gdb (6.8.50)). I reported the code gen bug (i686-specific), and learned that it's fixed on the trunk and for the upcoming 4.5.1: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D44806 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 17:36:56 2011 Received: (at control) by debbugs.gnu.org; 22 Jul 2011 21:36:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkNOy-0004Xq-E0 for submit@debbugs.gnu.org; Fri, 22 Jul 2011 17:36:56 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkNOu-0004Xe-U3 for control@debbugs.gnu.org; Fri, 22 Jul 2011 17:36:55 -0400 Received: from rho.meyering.net (localhost.localdomain [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 29B316006C for ; Fri, 22 Jul 2011 23:36:47 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: Re: [PATCH] hash: extend module to deal with non-pointer keys Date: Fri, 22 Jul 2011 23:36:47 +0200 Message-ID: <87aac680b4.fsf@rho.meyering.net> Lines: 4 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) close 6551 thanks This was resolved. From unknown Fri Jun 20 07:12:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Aug 2011 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator