public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World
@ 2021-01-26 20:07 aboya at igalia dot com
  2021-01-26 20:12 ` [Bug gdb/27253] " aboya at igalia dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: aboya at igalia dot com @ 2021-01-26 20:07 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27253
           Summary: gdb reliably crashes if restarting the inferior after
                    stepping into a Hello World
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: aboya at igalia dot com
  Target Milestone: ---

GNU gdb (GDB) Fedora 10.1-2.fc33

I wrote this code:

#include<iostream>
int main()
{
    std::cout << "Miau\n";

}

Then, I built:

$ g++ -O0 -g a.cpp

Then, I ran in gdb:

Reading symbols from ./a.out...
(gdb) b main
Breakpoint 1 at 0x40115a: file a.cpp, line 4.
(gdb) r
Starting program: /tmp/a.out 

Breakpoint 1, main () at a.cpp:4
4           std::cout << "Miau\n";
(gdb) s
std::operator<< <std::char_traits<char> > (__out=..., __s=0x402011 "Miau\n")
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/ostream:606
606         operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
(gdb) 
612                             
static_cast<streamsize>(_Traits::length(__s)));
(gdb) 
0x00007ffff7eca9c3 in std::char_traits<char>::length (__s=<optimized out>)
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/char_traits.h:364
364             return __builtin_strlen(__s);
(gdb) fin
Run till exit from #0  0x00007ffff7eca9c3 in std::char_traits<char>::length
(__s=<optimized out>)
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/char_traits.h:364
std::operator<< <std::char_traits<char> > (__out=..., __s=0x402011 "Miau\n")
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/ostream:612
612                             
static_cast<streamsize>(_Traits::length(__s)));
(gdb) s
0x00007ffff7eca9d4 in std::char_traits<char>::length (__s=0x402011 "Miau\n")
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/char_traits.h:364
364             return __builtin_strlen(__s);
(gdb) fin
Run till exit from #0  0x00007ffff7eca9d4 in std::char_traits<char>::length
(__s=0x402011 "Miau\n")
    at
/usr/src/debug/gcc-10.2.1-9.fc33.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/char_traits.h:364
Miau
main () at a.cpp:6
6       }
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
../../gdb/gdbtypes.c:5380: internal-error: Unexpected type field location kind:
4
A problem internal to GDB has been detected,
further debugging may prove unreliable.

I could reproduce the bug running gdb and repeating the same steps. The bug is
not reproduced if I don't step into the `cout <<` line.

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

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

* [Bug gdb/27253] gdb reliably crashes if restarting the inferior after stepping into a Hello World
  2021-01-26 20:07 [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World aboya at igalia dot com
@ 2021-01-26 20:12 ` aboya at igalia dot com
  2021-01-26 20:14 ` aboya at igalia dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: aboya at igalia dot com @ 2021-01-26 20:12 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Alicia Boya García <aboya at igalia dot com> ---
Created attachment 13163
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13163&action=edit
Core dump of gdb

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

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

* [Bug gdb/27253] gdb reliably crashes if restarting the inferior after stepping into a Hello World
  2021-01-26 20:07 [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World aboya at igalia dot com
  2021-01-26 20:12 ` [Bug gdb/27253] " aboya at igalia dot com
@ 2021-01-26 20:14 ` aboya at igalia dot com
  2021-01-26 20:19 ` emilio at crisal dot io
  2021-08-14 19:45 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: aboya at igalia dot com @ 2021-01-26 20:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Alicia Boya García <aboya at igalia dot com> ---
Some system info:

Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
Fedora 33 (Workstation Edition)
g++ (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)

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

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

* [Bug gdb/27253] gdb reliably crashes if restarting the inferior after stepping into a Hello World
  2021-01-26 20:07 [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World aboya at igalia dot com
  2021-01-26 20:12 ` [Bug gdb/27253] " aboya at igalia dot com
  2021-01-26 20:14 ` aboya at igalia dot com
@ 2021-01-26 20:19 ` emilio at crisal dot io
  2021-08-14 19:45 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: emilio at crisal dot io @ 2021-01-26 20:19 UTC (permalink / raw)
  To: gdb-prs

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

Emilio Cobos Álvarez (:emilio) <emilio at crisal dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |emilio at crisal dot io

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

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

* [Bug gdb/27253] gdb reliably crashes if restarting the inferior after stepping into a Hello World
  2021-01-26 20:07 [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World aboya at igalia dot com
                   ` (2 preceding siblings ...)
  2021-01-26 20:19 ` emilio at crisal dot io
@ 2021-08-14 19:45 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2021-08-14 19:45 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |tromey at sourceware dot org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
This seems to be a dup.

*** This bug has been marked as a duplicate of bug 27005 ***

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

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

end of thread, other threads:[~2021-08-14 19:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 20:07 [Bug gdb/27253] New: gdb reliably crashes if restarting the inferior after stepping into a Hello World aboya at igalia dot com
2021-01-26 20:12 ` [Bug gdb/27253] " aboya at igalia dot com
2021-01-26 20:14 ` aboya at igalia dot com
2021-01-26 20:19 ` emilio at crisal dot io
2021-08-14 19:45 ` 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).