public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/105057] New: [12 Regression] ICE: in get_or_create_cluster, at analyzer/store.cc:2658 with -fanalyzer
@ 2022-03-25 16:48 zsojka at seznam dot cz
  2022-03-25 20:35 ` [Bug analyzer/105057] " dmalcolm at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zsojka at seznam dot cz @ 2022-03-25 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105057
           Summary: [12 Regression] ICE: in get_or_create_cluster, at
                    analyzer/store.cc:2658 with -fanalyzer
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 52689
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52689&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:10:3: internal compiler error: in get_or_create_cluster, at
analyzer/store.cc:2658
   10 |   __builtin_memset (&s, 0, sizeof (s));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x82ead7 ana::store::get_or_create_cluster(ana::region const*)
        /repo/gcc-trunk/gcc/analyzer/store.cc:2658
0x1796ab2 ana::store::fill_region(ana::store_manager*, ana::region const*,
ana::svalue const*)
        /repo/gcc-trunk/gcc/analyzer/store.cc:2569
0x1759dc6 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*, bool*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1484
0x175c972 ana::region_model::on_stmt_pre(gimple const*, bool*, bool*,
ana::region_model_context*)
        /repo/gcc-trunk/gcc/analyzer/region-model.cc:1213
0x172a458 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*,
ana::path_context*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:1361
0x172d5a0 ana::exploded_graph::process_node(ana::exploded_node*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3755
0x172e592 ana::exploded_graph::process_worklist()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:3198
0x1730ac2 ana::impl_run_checkers(ana::logger*)
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5777
0x173195e ana::run_checkers()
        /repo/gcc-trunk/gcc/analyzer/engine.cc:5851
0x1720eb8 execute
        /repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ 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-r12-7816-20220325152629-gfe705dce2e1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/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
--disable-bootstrap --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-r12-7816-20220325152629-gfe705dce2e1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220325 (experimental) (GCC)

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

* [Bug analyzer/105057] [12 Regression] ICE: in get_or_create_cluster,  at analyzer/store.cc:2658 with -fanalyzer
  2022-03-25 16:48 [Bug analyzer/105057] New: [12 Regression] ICE: in get_or_create_cluster, at analyzer/store.cc:2658 with -fanalyzer zsojka at seznam dot cz
@ 2022-03-25 20:35 ` dmalcolm at gcc dot gnu.org
  2022-03-26 13:07 ` cvs-commit at gcc dot gnu.org
  2022-03-26 13:09 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-03-25 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-03-25
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

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

Confirmed; looks like I introduced this in
r12-7809-g5f6197d7c197f9d2b7fb2e1a19dac39a023755e8; I'm working on a fix.

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

* [Bug analyzer/105057] [12 Regression] ICE: in get_or_create_cluster,  at analyzer/store.cc:2658 with -fanalyzer
  2022-03-25 16:48 [Bug analyzer/105057] New: [12 Regression] ICE: in get_or_create_cluster, at analyzer/store.cc:2658 with -fanalyzer zsojka at seznam dot cz
  2022-03-25 20:35 ` [Bug analyzer/105057] " dmalcolm at gcc dot gnu.org
@ 2022-03-26 13:07 ` cvs-commit at gcc dot gnu.org
  2022-03-26 13:09 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-26 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:8c8993c75309901e03418eba1d6239b9a39a43b7

commit r12-7827-g8c8993c75309901e03418eba1d6239b9a39a43b7
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Fri Mar 25 16:50:51 2022 -0400

    analyzer: fix ICE on memset of untracked region [PR105057]

    In r12-7809-g5f6197d7c197f9d2b7fb2e1a19dac39a023755e8 I added an
    optimization to avoid tracking the state of certain memory regions
    in the store.

    Unfortunately, I didn't cover every way in which
    store::get_or_create_cluster can be called for a base region, leading
    to assertion failure ICEs in -fanalyzer on certain function calls
    with certain params.

    I've worked through all uses of store::get_or_create_cluster and found
    four places where the assertion could fire.

    This patch fixes them, and adds regression tests where possible.

    gcc/analyzer/ChangeLog:
            PR analyzer/105057
            * store.cc (binding_cluster::make_unknown_relative_to): Reject
            attempts to create a cluster for untracked base regions.
            (store::set_value): Likewise.
            (store::fill_region): Likewise.
            (store::mark_region_as_unknown): Likewise.

    gcc/testsuite/ChangeLog:
            PR analyzer/105057
            * gcc.dg/analyzer/fread-2.c: New test, as a regression test for
            ICE in store::set_value on untracked base region.
            * gcc.dg/analyzer/memset-2.c: Likewise, for ICE in
            store::fill_region.
            * gcc.dg/analyzer/strcpy-2.c: Likewise, for ICE in
            store::mark_region_as_unknown.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

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

* [Bug analyzer/105057] [12 Regression] ICE: in get_or_create_cluster,  at analyzer/store.cc:2658 with -fanalyzer
  2022-03-25 16:48 [Bug analyzer/105057] New: [12 Regression] ICE: in get_or_create_cluster, at analyzer/store.cc:2658 with -fanalyzer zsojka at seznam dot cz
  2022-03-25 20:35 ` [Bug analyzer/105057] " dmalcolm at gcc dot gnu.org
  2022-03-26 13:07 ` cvs-commit at gcc dot gnu.org
@ 2022-03-26 13:09 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-03-26 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by the above commit.

Sorry for the breakage, and thanks again for filing this bug.

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

end of thread, other threads:[~2022-03-26 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 16:48 [Bug analyzer/105057] New: [12 Regression] ICE: in get_or_create_cluster, at analyzer/store.cc:2658 with -fanalyzer zsojka at seznam dot cz
2022-03-25 20:35 ` [Bug analyzer/105057] " dmalcolm at gcc dot gnu.org
2022-03-26 13:07 ` cvs-commit at gcc dot gnu.org
2022-03-26 13:09 ` dmalcolm 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).