public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
@ 2022-01-20 19:56 emr-gnu at hev dot psu.edu
  2022-01-23 23:40 ` [Bug fortran/28801] " tromey at sourceware dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: emr-gnu at hev dot psu.edu @ 2022-01-20 19:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

            Bug ID: 28801
           Summary: "gdb/gdbtypes.h:441: internal-error: LONGEST
                    dynamic_prop::const_val() const: Assertion `m_kind ==
                    PROP_CONST' failed" when listing functions
           Product: gdb
           Version: 11.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: emr-gnu at hev dot psu.edu
  Target Milestone: ---

Created attachment 13919
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13919&action=edit
Source files and compiled binary

Compile using Intel OneAPI ifort version 2021.4.0:

ifort -g -c strip_string.for
ifort -g -c test.for
ifort -o test test.o strip_string.o

$ gdb ./test
(gdb) info functions
All defined functions:

File strip_string.for:
1: ../../binutils-gdb/gdb/gdbtypes.h:441: internal-error: LONGEST
dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

$ ./gdb -v
GNU gdb (GDB) 11.1.90.20220113-git

Compiled from git source of 11.1 tree (commit 707055a26 with 2e1875503
cherry-picked on top).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
@ 2022-01-23 23:40 ` tromey at sourceware dot org
  2022-01-23 23:40 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-01-23 23:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-23
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
          Component|gdb                         |fortran
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
It's not entirely Fortran-specific in theory, but moving it there anyway.

f77_get_upperbound assumes the property is either a constant or
undefined.  However this is PROP_LOCEXPR.

I'll attach a patch that helps, but I don't know if it's correct or not.
With the patch the "info functions" output starts:

(gdb) info func
All defined functions:

File strip_string.for:
1:      void strip_string(character*(*), character*(*) (1), INTEGER(4),
INTEGER(8), INTEGER(8));

File test.for:
1:      void test(void);

Non-debugging symbols:
0x0000000000402558  _init
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
  2022-01-23 23:40 ` [Bug fortran/28801] " tromey at sourceware dot org
@ 2022-01-23 23:40 ` tromey at sourceware dot org
  2022-01-27 12:33 ` aburgess at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-01-23 23:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Created attachment 13924
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13924&action=edit
patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
  2022-01-23 23:40 ` [Bug fortran/28801] " tromey at sourceware dot org
  2022-01-23 23:40 ` tromey at sourceware dot org
@ 2022-01-27 12:33 ` aburgess at redhat dot com
  2022-01-28 16:08 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aburgess at redhat dot com @ 2022-01-27 12:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

Andrew Burgess <aburgess at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aburgess at redhat dot com

--- Comment #3 from Andrew Burgess <aburgess at redhat dot com> ---
Tom,

I think that patch should go in.  It may not give the user the answer they
want, but given we immediately call the const_val method, I think checking only
for the UNDEFINED case seems a bad idea.

Just my thoughts...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
                   ` (2 preceding siblings ...)
  2022-01-27 12:33 ` aburgess at redhat dot com
@ 2022-01-28 16:08 ` tromey at sourceware dot org
  2022-02-02 14:48 ` aburgess at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-01-28 16:08 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Makes sense, though I'm procrastinating writing a test case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
                   ` (3 preceding siblings ...)
  2022-01-28 16:08 ` tromey at sourceware dot org
@ 2022-02-02 14:48 ` aburgess at redhat dot com
  2022-02-24 16:04 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aburgess at redhat dot com @ 2022-02-02 14:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

--- Comment #5 from Andrew Burgess <aburgess at redhat dot com> ---
Created attachment 13950
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13950&action=edit
possible test for this issue

An initial test for this issue, does this help at all?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
                   ` (4 preceding siblings ...)
  2022-02-02 14:48 ` aburgess at redhat dot com
@ 2022-02-24 16:04 ` tromey at sourceware dot org
  2022-02-24 21:38 ` cvs-commit at gcc dot gnu.org
  2022-02-24 21:39 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-02-24 16:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Thanks, Andrew.
I sent the patch finally.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
                   ` (5 preceding siblings ...)
  2022-02-24 16:04 ` tromey at sourceware dot org
@ 2022-02-24 21:38 ` cvs-commit at gcc dot gnu.org
  2022-02-24 21:39 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-24 21:38 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4c937052c13b13053559a5aa2b1345545a185ca5

commit 4c937052c13b13053559a5aa2b1345545a185ca5
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Feb 24 09:01:42 2022 -0700

    Fix crash in Fortran code

    PR fortran/28801 points out a gdb crash that can be provoked by
    certain Fortran code.  The bug is that f77_get_upperbound assumes the
    property is either a constant or undefined, but in this case it is
    PROP_LOCEXPR.

    This patch fixes the crash by making this function (and the
    lower-bound one as well) do the correct check before calling
    'const_val'.

    Thanks to Andrew for writing the test case.

    Co-authored-by: Andrew Burgess <aburgess@redhat.com>
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28801

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug fortran/28801] "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions
  2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
                   ` (6 preceding siblings ...)
  2022-02-24 21:38 ` cvs-commit at gcc dot gnu.org
@ 2022-02-24 21:39 ` tromey at sourceware dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2022-02-24 21:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28801

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-02-24 21:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 19:56 [Bug gdb/28801] New: "gdb/gdbtypes.h:441: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed" when listing functions emr-gnu at hev dot psu.edu
2022-01-23 23:40 ` [Bug fortran/28801] " tromey at sourceware dot org
2022-01-23 23:40 ` tromey at sourceware dot org
2022-01-27 12:33 ` aburgess at redhat dot com
2022-01-28 16:08 ` tromey at sourceware dot org
2022-02-02 14:48 ` aburgess at redhat dot com
2022-02-24 16:04 ` tromey at sourceware dot org
2022-02-24 21:38 ` cvs-commit at gcc dot gnu.org
2022-02-24 21:39 ` tromey at sourceware dot 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).