[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diffutils-3.7.41-7475 exercises undefined behaviour
From: |
Jim Meyering |
Subject: |
Re: diffutils-3.7.41-7475 exercises undefined behaviour |
Date: |
Wed, 28 Jul 2021 22:27:41 -0700 |
On Wed, Jul 28, 2021 at 2:09 AM Bruno Haible <bruno@clisp.org> wrote:
> Hi Jim,
>
> > Thanks again. Even though I never reproduced the issue, I've pushed
> > the following, which should resolve it:
> >
> > https://git.sv.gnu.org/cgit/diffutils.git/commit/?id=v3.7-42-g1aa7ccf
>
> No, the patch does not fully resolve the issue. I still get
>
> Conditional jump or move depends on uninitialised value(s)
> at 0x402256: block_compare (cmp.c:622)
> by 0x402256: cmp (cmp.c:465)
> by 0x402256: main (cmp.c:361)
>
> The reason is that valgrind is silent when you copy uninitialized values
> to a different memory locations, and complains only when these uninitialized
> values effectively have an effect. [1]
>
> Here, the original uninitialized values are buf1[read0] and buf0[read1].
>
> The attached patch fixes it (and does not introduce regressions in
> "make check" without valgrind).
Nice. Thank you. I've reverted my own change and applied/pushed yours
with only a trivial comment change.