GNU bug report logs - #64316
ASAN failures in dir.c

Previous Next

Package: diffutils;

Reported by: Gisle Vanem <gvanem <at> yahoo.no>

Date: Tue, 27 Jun 2023 13:06:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Gisle Vanem <gvanem <at> yahoo.no>
Cc: 64316 <at> debbugs.gnu.org
Subject: bug#64316: [bug-diffutils] bug#64316: ASAN failures in dir.c
Date: Wed, 28 Jun 2023 15:31:55 -0700
[Message part 1 (text/plain, inline)]
On 2023-06-28 03:32, Gisle Vanem wrote:
> 'PTRDIFF_T_MAX - - 3' folds to '-9223372036854775806'.
> 
> But how can 'linbuf_base' become negative?

Ordinarily it's zero, but it can be negative. It's never positive.

Thanks for the report. I reproduced the signed integer overflow issue 
with -fsanitize=undefined and installed the attached patch to fix it and 
add a regression test (and also a comment about linbuf_base).

Although I don't see how this would fix a "memory exhausted" error, 
please give the latest Git commit a try and see whether it fixes things 
for you.
[0001-diff-fix-xpalloc-related-signed-integer-overflow.patch (text/x-patch, attachment)]

This bug report was last modified 1 year and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.