public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior
@ 2023-12-08 18:03 ssbssa at sourceware dot org
  2023-12-08 18:08 ` [Bug c++/31128] " cvs-commit at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-08 18:03 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31128
           Summary: gdb crashes when trying to print a global variable
                    stub without a running inferior
           Product: gdb
           Version: 14.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: ssbssa at sourceware dot org
  Target Milestone: ---

It can be reproduced with this source:
```
struct S
{
  S (int);
  virtual ~S ();

  int m_i;
};

S s (5);

int main ()
{
  return 0;
}
```

And then just debugging the compiled object file:
```
$ g++ -g -c print-global-stub.cc
$ gdb -q print-global-stub.o
Reading symbols from print-global-stub.o...
(gdb) p s

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
```

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

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

* [Bug c++/31128] gdb crashes when trying to print a global variable stub without a running inferior
  2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
@ 2023-12-08 18:08 ` cvs-commit at gcc dot gnu.org
  2023-12-08 18:10 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-08 18:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>:

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

commit 576745e26c0ec76a53ba45b20af464628a50b3e4
Author: Hannes Domani <ssbssa@yahoo.de>
Date:   Fri Dec 8 19:06:14 2023 +0100

    Fix printing of global variable stubs if no inferior is running

    Since 3c45e9f915ae4aeab7312d6fc55a947859057572 gdb crashes when trying
    to print a global variable stub without a running inferior, because of
    a missing nullptr-check (the block_scope function took care of that
    check before it was converted to a method).

    With this check it works again:
    ```
    (gdb) print s
    $1 = <incomplete type>
    ```

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31128
    Approved-By: Tom Tromey <tom@tromey.com>

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

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

* [Bug c++/31128] gdb crashes when trying to print a global variable stub without a running inferior
  2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
  2023-12-08 18:08 ` [Bug c++/31128] " cvs-commit at gcc dot gnu.org
@ 2023-12-08 18:10 ` cvs-commit at gcc dot gnu.org
  2023-12-08 18:11 ` ssbssa at sourceware dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-08 18:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The gdb-14-branch branch has been updated by Hannes Domani
<ssbssa@sourceware.org>:

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

commit bc23ea51f8a83e9524dfb553baa8baacb29e68a9
Author: Hannes Domani <ssbssa@yahoo.de>
Date:   Fri Dec 8 19:06:14 2023 +0100

    Fix printing of global variable stubs if no inferior is running

    Since 3c45e9f915ae4aeab7312d6fc55a947859057572 gdb crashes when trying
    to print a global variable stub without a running inferior, because of
    a missing nullptr-check (the block_scope function took care of that
    check before it was converted to a method).

    With this check it works again:
    ```
    (gdb) print s
    $1 = <incomplete type>
    ```

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31128
    Approved-By: Tom Tromey <tom@tromey.com>
    (cherry picked from commit 576745e26c0ec76a53ba45b20af464628a50b3e4)

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

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

* [Bug c++/31128] gdb crashes when trying to print a global variable stub without a running inferior
  2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
  2023-12-08 18:08 ` [Bug c++/31128] " cvs-commit at gcc dot gnu.org
  2023-12-08 18:10 ` cvs-commit at gcc dot gnu.org
@ 2023-12-08 18:11 ` ssbssa at sourceware dot org
  2024-01-10 14:54 ` ssbssa at sourceware dot org
  2024-03-29  8:00 ` wingo at igalia dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-08 18:11 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

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

--- Comment #3 from Hannes Domani <ssbssa 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] 6+ messages in thread

* [Bug c++/31128] gdb crashes when trying to print a global variable stub without a running inferior
  2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
                   ` (2 preceding siblings ...)
  2023-12-08 18:11 ` ssbssa at sourceware dot org
@ 2024-01-10 14:54 ` ssbssa at sourceware dot org
  2024-03-29  8:00 ` wingo at igalia dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-10 14:54 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matt.fagnani at bell dot net

--- Comment #4 from Hannes Domani <ssbssa at sourceware dot org> ---
*** Bug 31226 has been marked as a duplicate of this bug. ***

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

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

* [Bug c++/31128] gdb crashes when trying to print a global variable stub without a running inferior
  2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
                   ` (3 preceding siblings ...)
  2024-01-10 14:54 ` ssbssa at sourceware dot org
@ 2024-03-29  8:00 ` wingo at igalia dot com
  4 siblings, 0 replies; 6+ messages in thread
From: wingo at igalia dot com @ 2024-03-29  8:00 UTC (permalink / raw)
  To: gdb-prs

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

Andy Wingo <wingo at igalia dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wingo at igalia dot com

--- Comment #5 from Andy Wingo <wingo at igalia dot com> ---
*** Bug 31560 has been marked as a duplicate of this bug. ***

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

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

end of thread, other threads:[~2024-03-29  8:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 18:03 [Bug c++/31128] New: gdb crashes when trying to print a global variable stub without a running inferior ssbssa at sourceware dot org
2023-12-08 18:08 ` [Bug c++/31128] " cvs-commit at gcc dot gnu.org
2023-12-08 18:10 ` cvs-commit at gcc dot gnu.org
2023-12-08 18:11 ` ssbssa at sourceware dot org
2024-01-10 14:54 ` ssbssa at sourceware dot org
2024-03-29  8:00 ` wingo at igalia dot com

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).