[Bug preprocessor/78569] "internal compiler error: in get_substring_ranges_for_loc" processing sprintf buffer overflow

dmalcolm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 29 19:50:00 GMT 2016


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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug report.

(In reply to Andrew Pinski from comment #1)
> I think this is also the same issue as PR 78498.

Thanks, but I think it's a separate issue.


The backtrace shows the ICE is at line 1388 of input.c, which would suggest
it's a failure of this assertion:

      gcc_assert (line_width >= (start.column - 1 + literal_length));

where it earlier called:

      const char *line = location_get_source_line (start.file, start.line,
                                                   &line_width);

I *think* what's happening is that that line is reading the latest on-disk copy
of the input file, but using location information based on the state of the
input file when the .i file was created.

I'm not able to reproduce this yet, but I'll try to based on the above theory.


More information about the Gcc-bugs mailing list