[Bug analyzer/107711] internal compiler error: Segmentation fault

urs at akk dot org gcc-bugzilla@gcc.gnu.org
Wed Nov 16 15:26:42 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107711

--- Comment #2 from urs at akk dot org ---
On Wed, Nov 16, 2022 at 02:41:40PM +0000, dmalcolm at gcc dot gnu.org wrote:
> Unfortunately I can't reproduce the ICE with the attachment.

Yes, attachment was created with "-v -save-temps -freport-bug" and with that
the crash doesn't show up.

Plain source is
<https://salsa.debian.org/md/tin/-/blob/master/src/makecfg.c>
but it needs a few makros like FreeIfNeeded from
<https://salsa.debian.org/md/tin/-/blob/master/include/tin.h>
which needs autoconf.h ... and so on

> I have a suspicion that this relates to commits r13-4073-gd8aba860b34203 and/or
> r13-4074-g86a90006864840 and that it relates to accessing preprocessor macros
> for named constants relating to file descriptors.
> 
> To confirm this hypothesis, does the crash go away if you first use -E to run
> the preprocessor on its own, and then use -fanalyzer on the preprocessed
> source? (with the same other options as before)

gcc-13 -E -I. -I../include -DHAVE_CONFIG_H -DDEBUG -o makecfg.i ./makecfg.c
gcc-13 -g -std=c11 -O2 -Wextra -Wpedantic -Wall -Winline -Wshadow
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wbad-function-cast -Wnested-externs -Wcast-align -Wpointer-arith
-Waggregate-return -Wcast-qual -Wwrite-strings -Wundef -Wpacked -Wfloat-equal
-Wunused-macros -Wold-style-definition -Winit-self -Wmissing-include-dirs
-Wlogical-op -Wjump-misses-init -Wformat=2 -Wshift-overflow=2
-Wnull-dereference -Wduplicated-cond -Walloc-zero -Walloca
-Wstringop-overflow=2 -Wduplicated-branches -Wno-format-nonliteral
-Wno-stringop-truncation -Wno-format-truncation -fanalyzer -o makecfg
./makecfg.i

works fine (, but then make fails on the next input file, again on the last
curly brace in the file):

compiling heapsort.o
./heapsort.c:187:1: internal compiler error: Segmentation fault
  187 | }
      | ^
0x7fd658e6251f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fd658e49d8f __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7fd658e49e3f __libc_start_main_impl
        ../csu/libc-start.c:392


niko% wc -l makecfg.c heapsort.c 
  552 makecfg.c
  188 heapsort.c

HTH,
urs


More information about the Gcc-bugs mailing list