public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238
@ 2022-11-21  7:42 asolokha at gmx dot com
  2022-11-21  8:25 ` [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2 marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2022-11-21  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107783
           Summary: [13 Regression] ICE in deref_rvalue, at
                    analyzer/region-model.cc:3238
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc 13.0.0 20221120 snapshot (g:a16a5460447eaaff0b4468064e4d7b1cc8fc42eb) ICEs
when compiling the following testcase w/ -fanalyzer:

int
foo (void)
{
  return bind (0, 0, 0);
}

% gcc-13 -fanalyzer -w -c oerlsfmf.c
during IPA pass: analyzer
oerlsfmf.c: In function 'foo':
oerlsfmf.c:4:10: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:3238
    4 |   return bind (0, 0, 0);
      |          ^~~~~~~~~~~~~~
0x7bd370 ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/region-model.cc:3238
0x13091e4 check_for_new_socket_fd
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/sm-fd.cc:1785
0x130b16d on_bind
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/sm-fd.cc:1848
0x130b16d ana::region_model::on_bind(ana::call_details const&, bool)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/sm-fd.cc:2284
0x12e7646 ana::kf_bind::outcome_of_bind::update_model(ana::region_model*,
ana::exploded_edge const*, ana::region_model_context*) const
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/region-model-impl-calls.cc:630
0x12a8cee ana::exploded_graph::process_node(ana::exploded_node*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/engine.cc:4170
0x12a984a ana::exploded_graph::process_worklist()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/engine.cc:3457
0x12abfd4 ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/engine.cc:6110
0x12acfd6 ana::run_checkers()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/engine.cc:6198
0x129b8d8 execute
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221120/work/gcc-13-20221120/gcc/analyzer/analyzer-pass.cc:87

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
@ 2022-11-21  8:25 ` marxin at gcc dot gnu.org
  2022-11-21 16:30 ` slyfox at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-11-21  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|[13 Regression] ICE in      |[13 Regression] ICE in
                   |deref_rvalue, at            |deref_rvalue, at
                   |analyzer/region-model.cc:32 |analyzer/region-model.cc:32
                   |38                          |38 since
                   |                            |r13-4074-g86a90006864840c2
   Last reconfirmed|                            |2022-11-21

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-4074-g86a90006864840c2.

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
  2022-11-21  8:25 ` [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2 marxin at gcc dot gnu.org
@ 2022-11-21 16:30 ` slyfox at gcc dot gnu.org
  2022-11-22  0:10 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: slyfox at gcc dot gnu.org @ 2022-11-21 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:

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

--- Comment #2 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Got the same ICE today on gnutls-3.7.8 package:

during IPA pass: analyzer
serv.c: In function 'listen_socket':
serv.c:1011:21: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:3238
 1011 |                 if (bind(s, ptr->ai_addr, ptr->ai_addrlen) < 0) {
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
  2022-11-21  8:25 ` [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2 marxin at gcc dot gnu.org
  2022-11-21 16:30 ` slyfox at gcc dot gnu.org
@ 2022-11-22  0:10 ` cvs-commit at gcc dot gnu.org
  2022-11-22  0:23 ` dmalcolm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-22  0:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:12a4785c9120beeef42f1bded52cc2674e206f57

commit r13-4220-g12a4785c9120beeef42f1bded52cc2674e206f57
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Mon Nov 21 19:08:17 2022 -0500

    analyzer: fix ICE on 'bind' with non-pointer arg [P107783]

    gcc/analyzer/ChangeLog:
            PR analyzer/107783
            * region-model-impl-calls.cc (kf_accept::matches_call_types_p):
            Require that args 1 and 2 be pointers.
            (kf_bind::matches_call_types_p): Require that arg 1 be a pointer.
            * region-model.h (call_details::arg_is_pointer_p): New

    gcc/testsuite/ChangeLog:
            PR analyzer/107783
            * gcc.dg/analyzer/fd-bind-pr107783.c: New test.

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

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-11-22  0:10 ` cvs-commit at gcc dot gnu.org
@ 2022-11-22  0:23 ` dmalcolm at gcc dot gnu.org
  2022-11-22  8:37 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-11-22  0:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.  The ICE in comment #0 should be fixed by the above
commit.

Sergei: does the above commit also fix the issue you describe in comment #2? 
Thanks.

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-11-22  0:23 ` dmalcolm at gcc dot gnu.org
@ 2022-11-22  8:37 ` rguenth at gcc dot gnu.org
  2022-11-22 22:32 ` cvs-commit at gcc dot gnu.org
  2022-11-22 22:44 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-22  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Priority|P3                          |P4

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-11-22  8:37 ` rguenth at gcc dot gnu.org
@ 2022-11-22 22:32 ` cvs-commit at gcc dot gnu.org
  2022-11-22 22:44 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-22 22:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:64fb291c5839e1a82afb62743172b4eab1267399

commit r13-4248-g64fb291c5839e1a82afb62743172b4eab1267399
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Nov 22 17:29:21 2022 -0500

    analyzer: fix ICE on 'bind(INT_CST, ...)' [PR107783]

    This was crashing inside fd_phase_mismatch's ctor with assertion
    failure when the state was "fd-constant".

    Fix the ICE by not complaining about constants passed to these APIs.

    gcc/analyzer/ChangeLog:
            PR analyzer/107783
            * sm-fd.cc (fd_state_machine::check_for_new_socket_fd): Don't
            complain when old state is "fd-constant".
            (fd_state_machine::on_listen): Likewise.
            (fd_state_machine::on_accept): Likewise.

    gcc/testsuite/ChangeLog:
            PR analyzer/107783
            * gcc.dg/analyzer/fd-accept.c (test_accept_on_constant): New.
            * gcc.dg/analyzer/fd-bind.c (test_bind_on_constant): New.
            * gcc.dg/analyzer/fd-connect.c (test_connect_on_constant): New.
            * gcc.dg/analyzer/fd-listen.c (test_listen_on_connected_socket):
            Fix typo.
            (test_listen_on_constant): New.

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

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

* [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2
  2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-11-22 22:32 ` cvs-commit at gcc dot gnu.org
@ 2022-11-22 22:44 ` dmalcolm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-11-22 22:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
I found another ICE with the new "bind"-handling code, which I fixed in the
above commit.

Marking this as resolved.

If you're still running into issues with the "bind"-handling code, please open
separate bugs for them.  Thanks!

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

end of thread, other threads:[~2022-11-22 22:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21  7:42 [Bug analyzer/107783] New: [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 asolokha at gmx dot com
2022-11-21  8:25 ` [Bug analyzer/107783] [13 Regression] ICE in deref_rvalue, at analyzer/region-model.cc:3238 since r13-4074-g86a90006864840c2 marxin at gcc dot gnu.org
2022-11-21 16:30 ` slyfox at gcc dot gnu.org
2022-11-22  0:10 ` cvs-commit at gcc dot gnu.org
2022-11-22  0:23 ` dmalcolm at gcc dot gnu.org
2022-11-22  8:37 ` rguenth at gcc dot gnu.org
2022-11-22 22:32 ` cvs-commit at gcc dot gnu.org
2022-11-22 22:44 ` 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).