This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/82939] New: genmatch fills up terminal with endless printing of periods
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Nov 2017 14:15:34 +0000
- Subject: [Bug preprocessor/82939] New: genmatch fills up terminal with endless printing of periods
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82939
Bug ID: 82939
Summary: genmatch fills up terminal with endless printing of
periods
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: egallager at gcc dot gnu.org
CC: bonzini at gnu dot org, dmalcolm at gcc dot gnu.org,
dodji at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-apple-darwin10
Target: x86_64-apple-darwin10
Build: x86_64-apple-darwin10
While trying to build gcc trunk today as of r254623, I ran into an issue where
genmatch looped infinitely printing periods until I had to kill it. Debugging
the issue in gdb, I traced it back to line 1391 in libcpp/linemap.c; svn blame
output for that portion of the code looks like this:
82199 bonzini /* Print an include trace, for e.g. the -H option of the
preprocessor. */
82199 bonzini
82199 bonzini static void
223365 dmalcolm trace_include (const struct line_maps *set, const
line_map_ordinary *map)
82199 bonzini {
82199 bonzini unsigned int i = set->depth;
82199 bonzini
82199 bonzini while (--i)
82199 bonzini putc ('.', stderr);
180081 dodji
180081 dodji fprintf (stderr, " %s\n", ORDINARY_MAP_FILE_NAME (map));
82199 bonzini }
Stepping into the loop, i turns out to be:
(gdb) p i
$2 = 1606398065
So I guess that's not actually infinite, but that's still an unreasonably large
value for i. Did it wrap around or something?
My configure args:
../configure --disable-werror --disable-werror-always
--enable-languages=c,c++,objc,obj-c++,lto --enable-stage1-checking=release,rtl
-C --with-system-libunwind --enable-secureplt --enable-frame-pointer
--enable-debug --without-isl --disable-host-shared --enable-maintainer-mode
--disable-default-pie --with-ld64 --without-pic --enable-target-optspace
--disable-nls --with-system-zlib --with-libiconv-prefix=/opt/local
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-lto
--with-build-config=bootstrap-debug --with-as=/opt/local/bin/as
--with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --enable-objc-gc
--enable-libada --enable-libssp --disable-libsanitizer CC='/usr/bin/gcc-4.2
-arch i386 -arch x86_64' CXX='/usr/bin/g++-4.2 -arch x86_64'
AR_FOR_TARGET=/opt/local/bin/ar AS_FOR_TARGET=/opt/local/bin/as
LD_FOR_TARGET=/opt/local/bin/ld NM_FOR_TARGET=/opt/local/bin/nm
RANLIB_FOR_TARGET=/opt/local/bin/ranlib STRIP_FOR_TARGET=/opt/local/bin/strip
OTOOL=/opt/local/bin/otool OTOOL64=/opt/local/bin/otool
AUTOCONF=/opt/local/bin/autoconf264 AUTOHEADER=/opt/local/bin/autoheader264
AUTOM4TE=/opt/local/bin/autom4te264 AUTORECONF=/opt/local/bin/autoreconf264
AUTOSCAN=/opt/local/bin/autoscan264 AUTOUPDATE=/opt/local/bin/autoupdate264
IFNAMES=/opt/local/bin/ifnames264 ACLOCAL=/sw/bin/aclocal-1.11
PERL=/opt/local/bin/perl CFLAGS='-pipe -g -Os' CXXFLAGS='-pipe -g -Os
-fcheck-new' CPP='/usr/bin/gcc-4.2 -E' CXXCPP='/usr/bin/g++-4.2 -E'
M4=/opt/local/bin/gm4