GNU bug report logs - #77828
LTO build fails with grep 3.12

Previous Next

Package: grep;

Reported by: Christian Hesse <list <at> eworm.de>

Date: Tue, 15 Apr 2025 17:03:03 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77828 in the body.
You can then email your comments to 77828 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#77828; Package grep. (Tue, 15 Apr 2025 17:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Hesse <list <at> eworm.de>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 15 Apr 2025 17:03:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christian Hesse <list <at> eworm.de>
To: bug-grep <at> gnu.org
Subject: LTO build fails with grep 3.12
Date: Tue, 15 Apr 2025 19:01:59 +0200
[Message part 1 (text/plain, inline)]
Hello everybody,

I am building grep 3.12 in a clean build environment for Arch Linux. That
fails when building with link time optimization is enabled:

  CCLD     grep
In function 'dfaoptimize',
    inlined from 'dfaanalyze' at ../lib/dfa.c:2873:3:
../lib/dfa.c:2606:12: error: writing 1 byte into a region of size 0
  [-Werror=stringop-overflow=] 2606 |   flags[0] |= OPT_QUEUED;
      |            ^
In function 'icalloc',
    inlined from 'xicalloc' at ../lib/xmalloc.c:304:10,
    inlined from 'xizalloc' at ../lib/xmalloc.c:289:10,
    inlined from 'dfaoptimize' at ../lib/dfa.c:2589:17,
    inlined from 'dfaanalyze' at ../lib/dfa.c:2873:3:
../lib/ialloc.h:91:10: note: destination object of size [0,
  9223372036854775807] allocated by 'calloc' 91 |   return calloc (n, s);
      |          ^
lto1: all warnings being treated as errors

The build succeed as soon as I disable link time optimization. Would be nice
to have a fix for this to reenable lto. Let me know if I can provide more
information on this. Thanks!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
[Message part 2 (application/pgp-signature, inline)]

bug closed, send any further explanations to 77828 <at> debbugs.gnu.org and Christian Hesse <list <at> eworm.de> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sun, 20 Apr 2025 06:35:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Apr 2025 06:37:02 GMT) Full text and rfc822 format available.

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 20 Apr 2025 06:42:02 GMT) Full text and rfc822 format available.

Notification sent to Christian Hesse <list <at> eworm.de>:
bug acknowledged by developer. (Sun, 20 Apr 2025 06:42:02 GMT) Full text and rfc822 format available.

Message #14 received at 77828-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Christian Hesse <list <at> eworm.de>
Cc: 77828-done <at> debbugs.gnu.org
Subject: Re: bug#77828: LTO build fails with grep 3.12
Date: Sat, 19 Apr 2025 23:41:17 -0700
[Message part 1 (text/plain, inline)]
On 2025-04-15 10:01, Christian Hesse wrote:

> The build succeed as soon as I disable link time optimization. Would be nice
> to have a fix for this to reenable lto.

Thanks for reporting that. It's a false alarm from GCC. I worked around 
the problem by installing the attached patch into Gnulib to pacify GCC, 
and I'm closing the grep bug report.
[0001-dfa-pacify-gcc-Wstringop-overflow.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 May 2025 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 59 days ago.

Previous Next


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