From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14CA33858D39; Thu, 8 Sep 2022 09:33:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14CA33858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662629581; bh=6TMoZ4IoskNRGPeO9uY5UILDg6dehj3fcHJYVjxk3w0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZhaSEbz5/mjPwqLLAlqIEwJuoriNFksr91WSM3f52RxEO+vZ5TYaZYekrjoPwrxwL Wu5CRxeiMLOyUOF1HvJcBv3LO7ii2GPq8HGicIYkcrBGmAzdaRLAebDpMlOMzra5Pz 3/SAgfj05miLt4pTZ+BCLjWJx6CssPnUrYy92LwY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106874] [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes Date: Thu, 08 Sep 2022 09:33:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106874 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2022-09-08 Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- Hmm, with GCC 11 I see > gcc-11 -c function_macro_file.c -traditional-cpp function_macro_file.h:2:1: error: expected '=3D', ',', ';', 'asm' or '__attribute__' at end of input 2 | f | ^ I can confirm with GCC 10. Also with a dev build of GCC 11, but not 12.=20 Backtrace there: #0 0x00007ffff6762c7e in exit () from /lib64/libc.so.6 #1 0x00000000021bd904 in xexit (code=3D1) at ../../src/gcc-11-branch/libiberty/xexit.c:51 #2 0x00000000021bd9e4 in xmalloc_failed (size=3D9223372036854299649) at ../../src/gcc-11-branch/libiberty/xmalloc.c:137 #3 0x00000000021bdaed in xrealloc (oldmem=3D0x32c9df0, size=3D922337203685= 4299649) at ../../src/gcc-11-branch/libiberty/xmalloc.c:181 #4 0x000000000217459b in check_output_buffer (pfile=3D0x3245a80,=20 n=3D18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional= .c:114 #5 0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=3D0x3245a80,=20 macro=3D0x0, builtin_macro_arg=3Dfalse) at ../../src/gcc-11-branch/libcpp/traditional.c:418 #6 0x0000000002174b4d in _cpp_read_logical_line_trad (pfile=3D0x3245a80) at ../../src/gcc-11-branch/libcpp/traditional.c:321 #7 0x0000000000aff763 in scan_translation_unit_trad (pfile=3D0x3245a80) at ../../src/gcc-11-branch/gcc/c-family/c-ppoutput.c:420 #8 0x0000000000afeb80 in preprocess_file (pfile=3D0x3245a80) at ../../src/gcc-11-branch/gcc/c-family/c-ppoutput.c:97 #9 0x0000000000afcb25 in c_common_init () ... #4 0x000000000217459b in check_output_buffer (pfile=3D0x3245a80,=20 n=3D18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional= .c:114 114 pfile->out.base =3D XRESIZEVEC (unsigned char, pfile->out.bas= e, new_size); (gdb) l 109 if (n > (size_t) (pfile->out.limit - pfile->out.cur)) 110 { 111 size_t size =3D pfile->out.cur - pfile->out.base; 112 size_t new_size =3D (size + n) * 3 / 2; 113 114 pfile->out.base =3D XRESIZEVEC (unsigned char, pfile->out.bas= e, new_size); (gdb) up #5 0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=3D0x3245a80,=20 macro=3D0x0, builtin_macro_arg=3Dfalse) at ../../src/gcc-11-branch/libcpp/traditional.c:418 418 check_output_buffer (pfile, RLIMIT (context) - cur); (gdb) p *context $2 =3D {next =3D 0x0, prev =3D 0x0, u =3D {iso =3D {first =3D {token =3D 0x= 32aa023,=20 ptoken =3D 0x32aa023}, last =3D {token =3D 0x325c820, ptoken =3D 0x= 325c820}},=20 trad =3D {cur =3D 0x32aa023 "\n\n", rlimit =3D 0x325c820 "\n"}}, buff = =3D 0x0,=20 c =3D {mc =3D 0x0, macro =3D 0x0}, tokens_kind =3D TOKENS_KIND_INDIRECT}=