[Bug c++/93788] New: Segfault caused by infinite loop in cc1plus

changochen1 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 17 17:33:00 GMT 2020


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

            Bug ID: 93788
           Summary: Segfault caused by infinite loop in cc1plus
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: changochen1 at gmail dot com
  Target Milestone: ---

POC:
---
int a{[] ( struct {
---

Run script:
---
cc1plus poc.c
---

Stack dump only says segemantation fault. When I debugged I found the segfault
is caused by an invalid stack address, which results from infinite loop:
---
#18499 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18500 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18501 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18502 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18503 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18504 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18505 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18506 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18507 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18508 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18509 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18510 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18511 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18512 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18513 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18514 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18515 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18516 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18517 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18518 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18519 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
#18520 0x000000000098754b in dump_aggr_type (t=0x7f3ae46520a8, flags=0x1,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3298
#18521 0x000000000098e894 in dump_scope (scope=<optimized out>,
flags=<optimized out>, pp=0x2804cc0 <actual_pretty_printer>) at
../../gcc/cp/error.c:209
#18522 0x0000000000987655 in dump_aggr_type (t=<optimized out>, flags=0x0,
pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3393
#18523 0x000000000098de07 in dump_parameters (parmtypes=0x7f3ae4643f78,
flags=0x0, pp=0x2804cc0 <actual_pretty_printer>) at ../../gcc/tree.h:3279
....
---


More information about the Gcc-bugs mailing list