[Bug other/88480] New: libiberty's use of VLAs causing stack overflow

tnfchris at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 13 10:49:00 GMT 2018


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

            Bug ID: 88480
           Summary: libiberty's use of VLAs causing stack overflow
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
                CC: davidledger at live dot com.au
  Target Milestone: ---

Originally reported as a binutils bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=23906

libiberty uses two VLAs when demangling symbols
https://github.com/gcc-mirror/gcc/blob/master/libiberty/cp-demangle.c#L4315

These VLAs when linking large C++ code bases with lots of templates cause a
stack exhaustion.

These should probably just be normal heap allocations so they scale properly.


More information about the Gcc-bugs mailing list