public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes
@ 2022-09-07 17:16 gscfq@t-online.de
  2022-09-08  9:33 ` [Bug c/106874] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gscfq@t-online.de @ 2022-09-07 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106874
           Summary: [10/11/12/13 Regression] out of memory allocating
                    9223372036854453969 bytes after a total of 462848
                    bytes
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r7, files are from catalog
llvm-project-llvmorg-14.0.6/clang/test/Preprocessor :


$ cat function_macro_file.h
#define f() x
f

$ cat function_macro_file.c
#include "function_macro_file.h"
()


$ gcc-13-20220904 -c function_macro_file.c -traditional-cpp

cc1: out of memory allocating 9223372036854277185 bytes after a total of 593920
bytes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/106874] [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes
  2022-09-07 17:16 [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes gscfq@t-online.de
@ 2022-09-08  9:33 ` rguenth at gcc dot gnu.org
  2022-09-08  9:33 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-08  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-09-08
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, with GCC 11 I see

> gcc-11 -c function_macro_file.c -traditional-cpp
function_macro_file.h:2:1: error: expected '=', ',', ';', '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. 
Backtrace there:

#0  0x00007ffff6762c7e in exit () from /lib64/libc.so.6
#1  0x00000000021bd904 in xexit (code=1)
    at ../../src/gcc-11-branch/libiberty/xexit.c:51
#2  0x00000000021bd9e4 in xmalloc_failed (size=9223372036854299649)
    at ../../src/gcc-11-branch/libiberty/xmalloc.c:137
#3  0x00000000021bdaed in xrealloc (oldmem=0x32c9df0, size=9223372036854299649)
    at ../../src/gcc-11-branch/libiberty/xmalloc.c:181
#4  0x000000000217459b in check_output_buffer (pfile=0x3245a80, 
    n=18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional.c:114
#5  0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=0x3245a80, 
    macro=0x0, builtin_macro_arg=false)
    at ../../src/gcc-11-branch/libcpp/traditional.c:418
#6  0x0000000002174b4d in _cpp_read_logical_line_trad (pfile=0x3245a80)
    at ../../src/gcc-11-branch/libcpp/traditional.c:321
#7  0x0000000000aff763 in scan_translation_unit_trad (pfile=0x3245a80)
    at ../../src/gcc-11-branch/gcc/c-family/c-ppoutput.c:420
#8  0x0000000000afeb80 in preprocess_file (pfile=0x3245a80)
    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=0x3245a80, 
    n=18446744073709234176) at ../../src/gcc-11-branch/libcpp/traditional.c:114
114           pfile->out.base = XRESIZEVEC (unsigned char, pfile->out.base,
new_size);
(gdb) l
109       if (n > (size_t) (pfile->out.limit - pfile->out.cur))
110         {
111           size_t size = pfile->out.cur - pfile->out.base;
112           size_t new_size = (size + n) * 3 / 2;
113
114           pfile->out.base = XRESIZEVEC (unsigned char, pfile->out.base,
new_size);
(gdb) up
#5  0x0000000002174eb3 in _cpp_scan_out_logical_line (pfile=0x3245a80, 
    macro=0x0, builtin_macro_arg=false)
    at ../../src/gcc-11-branch/libcpp/traditional.c:418
418       check_output_buffer (pfile, RLIMIT (context) - cur);
(gdb) p *context
$2 = {next = 0x0, prev = 0x0, u = {iso = {first = {token = 0x32aa023, 
        ptoken = 0x32aa023}, last = {token = 0x325c820, ptoken = 0x325c820}}, 
    trad = {cur = 0x32aa023 "\n\n", rlimit = 0x325c820 "\n"}}, buff = 0x0, 
  c = {mc = 0x0, macro = 0x0}, tokens_kind = TOKENS_KIND_INDIRECT}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/106874] [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes
  2022-09-07 17:16 [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes gscfq@t-online.de
  2022-09-08  9:33 ` [Bug c/106874] " rguenth at gcc dot gnu.org
@ 2022-09-08  9:33 ` rguenth at gcc dot gnu.org
  2022-09-08 21:17 ` [Bug preprocessor/106874] " pinskia at gcc dot gnu.org
  2022-10-19  6:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-08  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug preprocessor/106874] [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes
  2022-09-07 17:16 [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes gscfq@t-online.de
  2022-09-08  9:33 ` [Bug c/106874] " rguenth at gcc dot gnu.org
  2022-09-08  9:33 ` rguenth at gcc dot gnu.org
@ 2022-09-08 21:17 ` pinskia at gcc dot gnu.org
  2022-10-19  6:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-08 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=78581

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect this is a dup of bug 78581.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug preprocessor/106874] [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes
  2022-09-07 17:16 [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-09-08 21:17 ` [Bug preprocessor/106874] " pinskia at gcc dot gnu.org
@ 2022-10-19  6:03 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-19  6:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Really looks like a duplicate.

*** This bug has been marked as a duplicate of bug 78581 ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-19  6:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 17:16 [Bug c/106874] New: [10/11/12/13 Regression] out of memory allocating 9223372036854453969 bytes after a total of 462848 bytes gscfq@t-online.de
2022-09-08  9:33 ` [Bug c/106874] " rguenth at gcc dot gnu.org
2022-09-08  9:33 ` rguenth at gcc dot gnu.org
2022-09-08 21:17 ` [Bug preprocessor/106874] " pinskia at gcc dot gnu.org
2022-10-19  6:03 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).