public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type)
@ 2020-04-28 12:21 asolokha at gmx dot com
  2020-04-28 14:15 ` [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 marxin at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: asolokha at gmx dot com @ 2020-04-28 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94816
           Summary: ICE: Segmentation fault (in
                    ana::region_model::add_region_for_type)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.1-alpha20200426 snapshot (g:29f55115583a0dab6cbac749c4f0804fd88e9536)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/g++.dg/init/array51.C, w/ -O1 -fanalyzer:

struct jr;

struct ch {
  int jr::*rx;
};

ch
ad ()
{
  return ch ();
}

% g++-10.0.1 -O1 -fanalyzer -c noivoaih.C
during IPA pass: analyzer
noivoaih.C: In function 'ch ad()':
noivoaih.C:10:14: internal compiler error: Segmentation fault
   10 |   return ch ();
      |              ^
0xfebacf crash_signal
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/toplev.c:328
0x136769e ana::region_model::add_region_for_type(ana::region_id, tree_node*,
ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/region-model.cc:6491
0x136d918 ana::map_region::get_or_create(ana::region_model*, ana::region_id,
tree_node*, tree_node*, ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/region-model.cc:1832
0x136ec2e ana::region_model::copy_struct_region(ana::region_id,
ana::struct_region*, ana::struct_region*, ana::region_model_context*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/region-model.cc:1304
0x134e9d1 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::state_change*) const
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/engine.cc:1022
0x134f3e1 ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/engine.cc:2530
0x134f8ca ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/engine.cc:2348
0x134fffb ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/engine.cc:4029
0x1350bcc ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/engine.cc:4097
0x1345778 execute
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200426/work/gcc-10-20200426/gcc/analyzer/analyzer-pass.cc:84

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

* [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3
  2020-04-28 12:21 [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type) asolokha at gmx dot com
@ 2020-04-28 14:15 ` marxin at gcc dot gnu.org
  2020-04-28 17:26 ` cvs-commit at gcc dot gnu.org
  2020-04-28 17:55 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-28 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.3.0
     Ever confirmed|0                           |1
            Summary|ICE: Segmentation fault (in |ICE: Segmentation fault (in
                   |ana::region_model::add_regi |ana::region_model::add_regi
                   |on_for_type)                |on_for_type) since
                   |                            |r10-5950-g757bf1dff5e8cee3
   Target Milestone|---                         |10.0
      Known to fail|                            |10.0
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2020-04-28

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-5950-g757bf1dff5e8cee3.

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

* [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3
  2020-04-28 12:21 [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type) asolokha at gmx dot com
  2020-04-28 14:15 ` [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 marxin at gcc dot gnu.org
@ 2020-04-28 17:26 ` cvs-commit at gcc dot gnu.org
  2020-04-28 17:55 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-28 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4

commit r10-8015-g5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Apr 28 10:52:45 2020 -0400

    analyzer: fix ICE copying struct [PR 94816]

    PR analyzer/94816 reports an ICE when attempting to copy a struct
    containing a field for which add_region_for_type for fails (on
    an OFFSET_TYPE): the region for the src field comes from
    make_region_for_unexpected_tree_code which gives it a NULL type, and
    then the copy calls add_region_for_type which unconditionally
    dereferences the NULL type.

    This patch fixes the ICE by checking for NULL types in
    add_region_for_type.

    gcc/analyzer/ChangeLog:
            PR analyzer/94816
            * engine.cc (impl_region_model_context::on_unexpected_tree_code):
            Handle NULL tree.
            * region-model.cc (region_model::add_region_for_type): Handle
            NULL type.
            * region-model.h
            (test_region_model_context::on_unexpected_tree_code): Handle NULL
            tree.

    gcc/testsuite/ChangeLog:
            PR analyzer/94816
            * g++.dg/analyzer/pr94816.C: New test.

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

* [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3
  2020-04-28 12:21 [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type) asolokha at gmx dot com
  2020-04-28 14:15 ` [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 marxin at gcc dot gnu.org
  2020-04-28 17:26 ` cvs-commit at gcc dot gnu.org
@ 2020-04-28 17:55 ` dmalcolm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-04-28 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Thanks for filing this.  Should be fixed by the above commit.

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

end of thread, other threads:[~2020-04-28 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 12:21 [Bug analyzer/94816] New: ICE: Segmentation fault (in ana::region_model::add_region_for_type) asolokha at gmx dot com
2020-04-28 14:15 ` [Bug analyzer/94816] ICE: Segmentation fault (in ana::region_model::add_region_for_type) since r10-5950-g757bf1dff5e8cee3 marxin at gcc dot gnu.org
2020-04-28 17:26 ` cvs-commit at gcc dot gnu.org
2020-04-28 17:55 ` 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).