X-Loop: help-debbugs@HIDDEN Subject: bug#73636: 64-bit inodes can cause invalid message "mkid: warning: `A and `B' are the same file, but yield different scans!" Resent-From: John DelSignore <jdelsign@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-idutils@HIDDEN Resent-Date: Sat, 05 Oct 2024 06:02:01 +0000 Resent-Message-ID: <handler.73636.B.172810810831651 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 73636 X-GNU-PR-Package: idutils X-GNU-PR-Keywords: To: 73636 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-idutils@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.172810810831651 (code B ref -1); Sat, 05 Oct 2024 06:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Oct 2024 06:01:48 +0000 Received: from localhost ([127.0.0.1]:37116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1swxrP-0008EQ-LB for submit <at> debbugs.gnu.org; Sat, 05 Oct 2024 02:01:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:59316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jdelsign@HIDDEN>) id 1swmMC-0002w9-JI for submit <at> debbugs.gnu.org; Fri, 04 Oct 2024 13:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <jdelsign@HIDDEN>) id 1swmM7-0006kW-P6 for bug-idutils@HIDDEN; Fri, 04 Oct 2024 13:44:44 -0400 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <jdelsign@HIDDEN>) id 1swmM5-00057K-Sw for bug-idutils@HIDDEN; Fri, 04 Oct 2024 13:44:43 -0400 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-7acb0499ffeso199334685a.1 for <bug-idutils@HIDDEN>; Fri, 04 Oct 2024 10:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728063878; x=1728668678; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ygJDkTrEWXRrkIwaJrBZvep5RH603zlsO60kahU05tA=; b=bubUgg2GNR9AN2s3y27DZzE5xTogx+sPXYk4lqO5iD4WZcdhRzNmqGnUGI/GvvOky7 mWjKapM98K2Y7JkpdJaQDaO07d4GtydkQvYWZ9iGgqAxRB19nnT0vwG0sUu62N+rylIT a9C976J3UWyMWmqRUnfd1ilfhVLzZWQnuecEF9EbTzW3j5HpeQJ/5FEZgL+ddHcDnv4f oRM/BCNbdFNAh6WsbGvNm4uSbW9m9hNdSHZgui1GtUlGqvygfHJ93DoloQBptKGjxIgc 5ggpr2QItGkJEmd6+sNN+iTe48QwSnjiYjW49bPdNWfz+xjTx406pUqzC/rNYZj/fDYY 0JZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728063878; x=1728668678; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ygJDkTrEWXRrkIwaJrBZvep5RH603zlsO60kahU05tA=; b=gfuyd6vZAB49oZh7Q2z44nVbLepueg5YRt1bsieeicmJJqug6rlAoQf26ce3p93gFj PeCFhc6ZomqL331MX4W6k8WrW0gKN968v0JE8f2hkS9vowcl9kSpZLRs6+Pwp1H8F7G/ 9gPdtEQMYiFFFFKme1F9t+J99SwoVImKSyV4OOCa8VvW90PfcerZ7wIi5n9j4ugBQXKU 1DrNK7uRYlS/kiSOwS/62oiNU/xSUQ828SX4uRSCqd1+qKBK7r1GfI/o38kknCPH7Esr BeSB8s6bIvfBVT04RGOgqNuik4qUcR2YMGlOrPCoh7YZavlC+DnxMkGW9upICUB4/evV cAaA== X-Gm-Message-State: AOJu0YxZtBktV/weY6aFLWVn/j1kiMqmKwdsCSe5Kn0Gv4FGzOXWlbFB Vas41BSdt79k7s0ZQlb6uX44TKw2iDXRlM5DLdd3+KLODahKokSSKqmXlQ== X-Google-Smtp-Source: AGHT+IGt+54hRiTS8vtY7V91fDU53mF1eK7jRFIDKKVwKU4TOj6MRly5JNeh9rzF8jD5E2SobYlxVg== X-Received: by 2002:a05:620a:2496:b0:79f:148:d834 with SMTP id af79cd13be357-7ae6f4a81bdmr721916885a.59.1728063878409; Fri, 04 Oct 2024 10:44:38 -0700 (PDT) Received: from [192.168.1.234] (pool-108-20-179-246.bstnma.fios.verizon.net. [108.20.179.246]) by smtp.googlemail.com with ESMTPSA id af79cd13be357-7ae7561ff5asm5278885a.3.2024.10.04.10.44.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Oct 2024 10:44:37 -0700 (PDT) Message-ID: <ab6f13e3-57b2-4dad-93bd-08cb36fe8806@HIDDEN> Date: Fri, 4 Oct 2024 13:44:35 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: John DelSignore <jdelsign@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::72b; envelope-from=jdelsign@HIDDEN; helo=mail-qk1-x72b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Sat, 05 Oct 2024 02:01:46 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) Hi, I've been using the idutils for 30+ years. We recently moved to a NetApp NFS filesystem that uses 64-bit inodes. With that new filesystem, mkid generates a message like: "mkid: warning: `A and `B' are the same file, but yield different scans!" for hundreds of source files. Here is one example: mkid: warning: `/nfs/homes/jdelsign/src/totalview.develop/cs/graphics/glyphd/motif/txelipse.cc' and `/nfs/homes/jdelsign/src/totalview.develop/3rdparty/mrnet/MRNet/src/parser.y' are the same file, but yield different scans! However, the files are definitely not the same: % ls -i /nfs/homes/jdelsign/src/totalview.develop/cs/graphics/glyphd/motif/txelipse.cc /nfs/homes/jdelsign/src/totalview.develop/3rdparty/mrnet/MRNet/src/parser.y 9257776846609958295 /nfs/homes/jdelsign/src/totalview.develop/3rdparty/mrnet/MRNet/src/parser.y 9257776842314990999 /nfs/homes/jdelsign/src/totalview.develop/cs/graphics/glyphd/motif/txelipse.cc % If I convert the inode numbers to hex, we have: 9257776846609958295 -> 0x807a3afe0005c597 9257776842314990999 -> 0x807a3afd0005c597 Notice the difference is in the top 32-bits, and the bottom 32-bits are equal, so mkid thinks they are the same file. I ran mkid under a debugger to try to determine the source of the error. The problem seems to be that the hash table INTEGER_COMPARE macro assumes that the result is the same size at the integers being compared, and for dev/ino comparison the result is truncated from 64-bits to 32-bits. Here's the code: static int dev_ino_hash_compare (void const *x, void const *y) { int result; INTEGER_COMPARE (((struct dev_ino const *) x)->di_ino, ((struct dev_ino const *) y)->di_ino, result); if (result) return result; INTEGER_COMPARE (((struct dev_ino const *) x)->di_dev, ((struct dev_ino const *) y)->di_dev, result); return result; } Both di_ino and di_dev are 64-bits, so performing a subtraction and storing the difference in a 32-bit result is not valid. I tried the following change and it seems to eliminate the warning messages: lid 52 10/04 9:30 ~/src/tools-external/idutils-4.6 % diff -u libidu/idu-hash.h.~1~ libidu/idu-hash.h --- libidu/idu-hash.h.~1~ 2012-01-01 04:16:06.000000000 -0500 +++ libidu/idu-hash.h 2024-10-04 09:27:29.558975000 -0400 @@ -128,7 +128,7 @@ } while (0) #define INTEGER_COMPARE(_x_, _y_, _result_) do { \ - (_result_) = _x_ - _y_; \ + (_result_) = _x_ < _y_ ? -1 : _x_ > _y_ ? 1 : 0; \ } while (0) #define return_INTEGER_COMPARE(_x_, _y_) do { \ int result; \ lid 53 10/04 9:30 ~/src/tools-external/idutils-4.6 % Cheers, John D.
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: John DelSignore <jdelsign@HIDDEN> Subject: bug#73636: Acknowledgement (64-bit inodes can cause invalid message "mkid: warning: `A and `B' are the same file, but yield different scans!") Message-ID: <handler.73636.B.172810810831651.ack <at> debbugs.gnu.org> References: <ab6f13e3-57b2-4dad-93bd-08cb36fe8806@HIDDEN> X-Gnu-PR-Message: ack 73636 X-Gnu-PR-Package: idutils Reply-To: 73636 <at> debbugs.gnu.org Date: Sat, 05 Oct 2024 06:02:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-idutils@HIDDEN If you wish to submit further information on this problem, please send it to 73636 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 73636: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73636 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.