[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new cmp -i 99999999999999999999 failure
From: |
Paul Eggert |
Subject: |
Re: new cmp -i 99999999999999999999 failure |
Date: |
Sun, 25 Jun 2023 15:33:39 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
On 2023-06-25 12:26, Jim Meyering wrote:
I was surprised to see your just-added "cmp" test failing, but only on Fedora
38.
This would report a difference:
echo a>a;echo b>b; src/cmp -i 99999999999999999999 a b
Hmm, it doesn't fail for me on Fedora 38 x86-64. uname -a reports:
Linux penguin.cs.ucla.edu 6.3.8-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC
Thu Jun 15 02:15:40 UTC 2023 x86_64 GNU/Linux
and 'dnf list glibc' says it's 2.37-4.fc38.
What file system are you using? I ran my tests on ext4, and on tmpfs,
and they all worked without your patch installed.
What does strace say?
Is there some ulimit thing that prevents large lseeks?
A downside of the patch is that it breaks cmp on growing files due to a
TOCTOU race. Is there some better way to work around the problem,
whatever it is?
In trying out the patch I discovered that it sometimes called read with
very large sizes, and fixed that with the attached. I think this bug
happened even without the patch.
0001-cmp-do-not-try-to-read-2-64-1-bytes.patch
Description: Text Data