public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug driver/111700] New: ICE: SIGSEGV in needs_read_p (input.cc:598) with -fdiagnostics-format=sarif-file or -fdiagnostics-format=sarif-stderr on pre-processed input
Date: Thu, 05 Oct 2023 05:27:22 +0000	[thread overview]
Message-ID: <bug-111700-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 111700
           Summary: ICE: SIGSEGV in needs_read_p (input.cc:598) with
                    -fdiagnostics-format=sarif-file or
                    -fdiagnostics-format=sarif-stderr on pre-processed
                    input
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: diagnostic, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Compiler output:

$ cat tmp.i
# 0 ""
x;

$ x86_64-pc-linux-gnu-gcc -fdiagnostics-format=sarif-stderr tmp.i -wrapper
valgrind,-q
==21217== Invalid read of size 8
==21217==    at 0x289B3E4: needs_read_p (input.cc:598)
==21217==    by 0x289B3E4: maybe_read_data (input.cc:665)
==21217==    by 0x289B3E4: file_cache_slot::get_next_line(char**, long*)
(input.cc:715)
==21217==    by 0x289C6BF: get_full_file_content (input.cc:471)
==21217==    by 0x289C6BF: file_cache::get_source_file_content(char const*)
(input.cc:1075)
==21217==    by 0x2877B83:
sarif_builder::maybe_make_artifact_content_object(char const*) const
(diagnostic-format-sarif.cc:1545)
==21217==    by 0x2877D1F: sarif_builder::make_artifact_object(char const*)
(diagnostic-format-sarif.cc:1524)
==21217==    by 0x2879FF7: sarif_builder::make_run_object(sarif_invocation*,
json::array*) (diagnostic-format-sarif.cc:1340)
==21217==    by 0x287A22E:
sarif_builder::make_top_level_object(sarif_invocation*, json::array*)
(diagnostic-format-sarif.cc:1296)
==21217==    by 0x287A285: sarif_builder::flush_to_file(_IO_FILE*)
(diagnostic-format-sarif.cc:473)
==21217==    by 0x287C200: ~sarif_stream_output_format
(diagnostic-format-sarif.cc:1749)
==21217==    by 0x287C200:
sarif_stream_output_format::~sarif_stream_output_format()
(diagnostic-format-sarif.cc:1750)
==21217==    by 0x286E861: diagnostic_finish(diagnostic_context*)
(diagnostic.cc:304)
==21217==    by 0xDBAA7F: toplev::main(int, char**) (toplev.cc:2310)
==21217==    by 0xDBCA7A: main (main.cc:39)
==21217==  Address 0x10 is not stack'd, malloc'd or (recently) free'd


$ x86_64-pc-linux-gnu-gcc -fdiagnostics-format=sarif-file tmp.i -wrapper
valgrind,-q
==32755== Invalid read of size 8
==32755==    at 0x289B3E4: needs_read_p (input.cc:598)
==32755==    by 0x289B3E4: maybe_read_data (input.cc:665)
==32755==    by 0x289B3E4: file_cache_slot::get_next_line(char**, long*)
(input.cc:715)
==32755==    by 0x289C6BF: get_full_file_content (input.cc:471)
==32755==    by 0x289C6BF: file_cache::get_source_file_content(char const*)
(input.cc:1075)
==32755==    by 0x2877B83:
sarif_builder::maybe_make_artifact_content_object(char const*) const
(diagnostic-format-sarif.cc:1545)
==32755==    by 0x2877D1F: sarif_builder::make_artifact_object(char const*)
(diagnostic-format-sarif.cc:1524)
==32755==    by 0x2879FF7: sarif_builder::make_run_object(sarif_invocation*,
json::array*) (diagnostic-format-sarif.cc:1340)
==32755==    by 0x287A22E:
sarif_builder::make_top_level_object(sarif_invocation*, json::array*)
(diagnostic-format-sarif.cc:1296)
==32755==    by 0x287A285: sarif_builder::flush_to_file(_IO_FILE*)
(diagnostic-format-sarif.cc:473)
==32755==    by 0x287BE31:
sarif_file_output_format::~sarif_file_output_format()
(diagnostic-format-sarif.cc:1778)
==32755==    by 0x287C018:
sarif_file_output_format::~sarif_file_output_format()
(diagnostic-format-sarif.cc:1781)
==32755==    by 0x286E861: diagnostic_finish(diagnostic_context*)
(diagnostic.cc:304)
==32755==    by 0xDBAA7F: toplev::main(int, char**) (toplev.cc:2310)
==32755==    by 0xDBCA7A: main (main.cc:39)
==32755==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==32755== 
error: unable to open '' for writing: No such file or directory
Internal compiler error:
0x14a9ccf crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:314
...

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20231003001722-g41d1c9a9795-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20231003001722-g41d1c9a9795-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231003 (experimental) (GCC)

             reply	other threads:[~2023-10-05  5:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05  5:27 zsojka at seznam dot cz [this message]
2023-10-06 13:59 ` [Bug driver/111700] " dmalcolm at gcc dot gnu.org
2023-10-08 22:50 ` cvs-commit at gcc dot gnu.org
2023-10-08 23:07 ` dmalcolm at gcc dot gnu.org
2024-05-09 17:12 ` cvs-commit at gcc dot gnu.org
2024-05-10 18:54 ` dmalcolm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111700-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).