GNU bug report logs - #19784
build fails on make-prime-list when asan is enabled

Previous Next

Package: coreutils;

Reported by: Yury Usishchev <y.usishchev <at> samsung.com>

Date: Thu, 5 Feb 2015 16:53:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yury Usishchev <y.usishchev <at> samsung.com>
To: 19784 <at> debbugs.gnu.org
Cc: Vyacheslav Barinov <v.barinov <at> samsung.com>, 박찬호 <chanho61.park <at> samsung.com>
Subject: bug#19784: build fails on make-prime-list when asan is enabled
Date: Thu, 05 Feb 2015 18:21:06 +0300
[Message part 1 (text/plain, inline)]
Hello!

We tried to build coreutils with address sanitizer enabled and 
encountered an error:

  GEN      src/primes.h
==12657== ERROR: AddressSanitizer: heap-buffer-overflow

This can be reproduced on git master using gcc-4.8 or gcc-4.9 by
git clone
export CFLAGS="-fsanitize=address"
./bootstrap
./configure
make

and is caused by line
src/make-prime-list.c:214:      while (i < size && sieve[++i] == 0)

When 'i' reaches 'size-1' it gets incremented and then 
(unallocated)memory is accessed.

I attached patch that can fix this issue.

-- 
BR,
Yury Usishchev

[asan_prime_fix.diff (text/x-diff, attachment)]

This bug report was last modified 10 years and 171 days ago.

Previous Next


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