public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
@ 2020-12-02 23:34 schwab@linux-m68k.org
  2021-03-27 10:10 ` [Bug gdb/27005] " domen.stangar at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2020-12-02 23:34 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27005
           Summary: ../../gdb/gdb/gdbtypes.c:5443: internal-error:
                    Unexpected type field location kind: 4
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: schwab@linux-m68k.org
  Target Milestone: ---

$ cat thread1.cc
#include <thread>  

void threadfunc();  

struct StaticThread {
    std::thread t;  
    StaticThread() : t(threadfunc) {}
    ~StaticThread() { t.join(); }
};  

static StaticThread thread1, thread2;
$ cat thread2.cc
#include <iostream>  

void threadfunc() {
    std::cout << "Printing\n";
}  

int main() {}
$ g++ -g thread[12].cc -pthread
$ gdb a.out
GNU gdb (GDB) 11.0.50.20201202-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x401499: file thread2.cc, line 7.
Starting program: /daten/src/test/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff6ed1700 (LWP 20157)]
[New Thread 0x7ffff66d0700 (LWP 20158)]

Thread 2 "a.out" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6ed1700 (LWP 20157)]
0x00007ffff7b2d5da in std::ostream::sentry::sentry (this=0x7ffff6ed0d80,
__os=...) at
/usr/src/debug/gcc10-10.2.1+git583-lp152.2.2.x86_64/obj-x86_64-suse-linux/x86_64-suse-linux/libstdc++-v3/include/bits/ostream.tcc:51
51            if (__os.tie() && __os.good())
(gdb) watch std::ios_base::Init::_S_refcount
Hardware watchpoint 2: std::ios_base::Init::_S_refcount
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location
kind: 4
A problem internal to GDB has been detected,

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

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

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
@ 2021-03-27 10:10 ` domen.stangar at gmail dot com
  2021-03-28  2:08 ` simark at simark dot ca
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: domen.stangar at gmail dot com @ 2021-03-27 10:10 UTC (permalink / raw)
  To: gdb-prs

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

Domen <domen.stangar at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |domen.stangar at gmail dot com

--- Comment #1 from Domen <domen.stangar at gmail dot com> ---
I did try with same source code, but i am unable to reply same.
But i have same issue with different code code.

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
../../gdb/gdbtypes.c:5573: internal-error: Unexpected type field location kind:
4
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

../../gdb/gdbtypes.c:5573: internal-error: Unexpected type field location kind:
4
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Aborted (core dumped)
root@amd1:/tmp/build/thrift_test# gdb /usr/bin/gdb core
GNU gdb (GDB) 11.0.50.20210327-git

backtrace of core
#0  0x00007f3177f15315 in raise () from /lib64/libc.so.6
#1  0x00007f3177f0548a in abort () from /lib64/libc.so.6
#2  0x00000000007da587 in dump_core () at ../../gdb/utils.c:204
#3  0x00000000007df1d5 in internal_vproblem(internal_problem *, const char *,
int, const char *, typedef __va_list_tag __va_list_tag *) (problem=0xc427e0
<internal_error_problem>,
    file=<optimized out>, line=5573, fmt=<optimized out>, ap=<optimized out>)
at ../../gdb/utils.c:414
#4  0x00000000007df3b9 in internal_verror (file=<optimized out>,
line=<optimized out>, fmt=<optimized out>, ap=ap@entry=0x7ffe201cb4d8) at
../../gdb/utils.c:439
#5  0x00000000008bd142 in internal_error (file=file@entry=0x975ff6
"../../gdb/gdbtypes.c", line=line@entry=5573, fmt=<optimized out>) at
../../gdbsupport/errors.cc:55
#6  0x00000000005d1d60 in copy_type_recursive
(objfile=objfile@entry=0x16fcca90, type=0x2213a290,
copied_types=copied_types@entry=0x2f12630) at ../../gdb/gdbtypes.c:5573
#7  0x00000000005d182b in copy_type_recursive
(objfile=objfile@entry=0x16fcca90, type=0x22046410,
copied_types=copied_types@entry=0x2f12630) at ../../gdb/gdbtypes.h:641
#8  0x00000000005d194a in copy_type_recursive
(objfile=objfile@entry=0x16fcca90, type=0x2213a6d0,
copied_types=copied_types@entry=0x2f12630) at ../../gdb/gdbtypes.c:5600
#9  0x00000000007f24c5 in preserve_one_value (value=0x27317330,
objfile=objfile@entry=0x16fcca90, copied_types=copied_types@entry=0x2f12630) at
../../gdb/value.c:2529
#10 0x00000000005f597f in gdbscm_preserve_values (extlang=<optimized out>,
objfile=0x16fcca90, copied_types=0x2f12630) at ../../gdb/guile/scm-value.c:94
#11 0x00000000005a381e in preserve_ext_lang_values
(objfile=objfile@entry=0x16fcca90, copied_types=0x2f12630) at
../../gdb/extension.c:542
#12 0x00000000007f25c5 in preserve_values (objfile=objfile@entry=0x16fcca90) at
/usr/include/c++/10.2.0/bits/unique_ptr.h:173
#13 0x0000000000695b9e in objfile::~objfile (this=0x16fcca90,
__in_chrg=<optimized out>) at ../../gdb/objfiles.c:551
#14 0x0000000000697b52 in std::_Sp_counted_ptr<objfile*,
(__gnu_cxx::_Lock_policy)2>::_M_dispose (this=<optimized out>) at
/usr/include/c++/10.2.0/bits/shared_ptr_base.h:380
#15 0x00000000006b548a in
std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x71d8720)
at /usr/include/c++/10.2.0/bits/shared_ptr_base.h:158
#16 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count
(this=0x1e541b08, __in_chrg=<optimized out>) at
/usr/include/c++/10.2.0/bits/shared_ptr_base.h:733
#17 std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr
(this=0x1e541b00, __in_chrg=<optimized out>) at
/usr/include/c++/10.2.0/bits/shared_ptr_base.h:1183
#18 std::shared_ptr<objfile>::~shared_ptr (this=0x1e541b00,
__in_chrg=<optimized out>) at /usr/include/c++/10.2.0/bits/shared_ptr.h:121
#19 __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> >
>::destroy<std::shared_ptr<objfile> > (__p=0x1e541b00, this=0x2374a60)
    at /usr/include/c++/10.2.0/ext/new_allocator.h:156
#20
std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> >
> >::destroy<std::shared_ptr<objfile> > (__p=0x1e541b00, __a=...)
    at /usr/include/c++/10.2.0/bits/alloc_traits.h:531
#21 std::__cxx11::list<std::shared_ptr<objfile>,
std::allocator<std::shared_ptr<objfile> > >::_M_erase
(__position=std::shared_ptr<objfile> (expired, weak count 1) = {get() =
0x16fcca90},
    this=0x2374a60) at /usr/include/c++/10.2.0/bits/stl_list.h:1925
#22 std::__cxx11::list<std::shared_ptr<objfile>,
std::allocator<std::shared_ptr<objfile> > >::erase
(__position=std::shared_ptr<objfile> (expired, weak count 1) = {get() =
0x16fcca90},
    this=0x2374a60) at /usr/include/c++/10.2.0/bits/list.tcc:158
#23 program_space::remove_objfile (this=0x2374a20, objfile=0x16fcca90) at
../../gdb/progspace.c:210
#24 0x0000000000695f26 in objfile::unlink (this=<optimized out>) at
../../gdb/objfiles.c:489
#25 objfile_purge_solibs () at ../../gdb/objfiles.c:877
#26 0x0000000000735242 in no_shared_libraries (ignored=ignored@entry=0x0,
from_tty=from_tty@entry=1) at ../../gdb/solib.c:1231
#27 0x000000000078fdf1 in target_pre_inferior (from_tty=from_tty@entry=1) at
../../gdb/target.c:2495
#28 0x0000000000610dd8 in run_command_1 (args=0x0, from_tty=1,
run_how=RUN_NORMAL) at ../../gdb/infcmd.c:431
#29 0x00000000004e4122 in cmd_func (cmd=<optimized out>, args=<optimized out>,
from_tty=<optimized out>) at ../../gdb/cli/cli-decode.c:2181
#30 0x000000000079fb26 in execute_command (p=<optimized out>, p@entry=0x3b9f7a0
"", from_tty=1) at ../../gdb/top.c:669
#31 0x000000000059f45d in command_handler (command=0x3b9f7a0 "") at
../../gdb/event-top.c:589
#32 0x000000000059f77b in command_line_handler (rl=...) at
../../gdb/event-top.c:774
#33 0x000000000059fd60 in gdb_rl_callback_handler (rl=0x928e4b0 "r") at
../../gdb/event-top.c:219
#34 0x00007f3178fba43e in rl_callback_read_char () from
/usr/lib64/libreadline.so.8
#35 0x000000000059ea8e in gdb_rl_callback_read_char_wrapper_noexcept () at
../../gdb/event-top.c:177
#36 0x000000000059fc4e in gdb_rl_callback_read_char_wrapper
(client_data=<optimized out>) at ../../gdb/event-top.c:194
#37 0x000000000059e830 in stdin_event_handler (error=<optimized out>,
client_data=0x21c8f30) at ../../gdb/event-top.c:516
#38 0x00000000008bd91e in gdb_wait_for_event (block=block@entry=1) at
../../gdbsupport/event-loop.cc:701
#39 0x00000000008bdbbf in gdb_wait_for_event (block=1) at
../../gdbsupport/event-loop.cc:597
#40 gdb_do_one_event () at ../../gdbsupport/event-loop.cc:237
#41 0x0000000000660295 in start_event_loop () at ../../gdb/main.c:348
#42 captured_command_loop () at ../../gdb/main.c:408
#43 0x0000000000662095 in captured_main (data=data@entry=0x7ffe201cbc50) at
../../gdb/main.c:1242
#44 gdb_main (args=args@entry=0x7ffe201cbc80) at ../../gdb/main.c:1257
#45 0x0000000000438b95 in main (argc=<optimized out>, argv=<optimized out>) at
../../gdb/gdb.c:32

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

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

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
  2021-03-27 10:10 ` [Bug gdb/27005] " domen.stangar at gmail dot com
@ 2021-03-28  2:08 ` simark at simark dot ca
  2021-08-14 19:45 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: simark at simark dot ca @ 2021-03-28  2:08 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
I was able to reproduce with Andreas' instruction.  With gcc 10.2.0 on Arch
Linux, if that matters.

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

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

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
  2021-03-27 10:10 ` [Bug gdb/27005] " domen.stangar at gmail dot com
  2021-03-28  2:08 ` simark at simark dot ca
@ 2021-08-14 19:45 ` tromey at sourceware dot org
  2022-03-06 16:37 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ 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=27005

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 27253 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] 7+ messages in thread

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
                   ` (2 preceding siblings ...)
  2021-08-14 19:45 ` tromey at sourceware dot org
@ 2022-03-06 16:37 ` tromey at sourceware dot org
  2022-03-06 16:41 ` tromey at sourceware dot org
  2022-03-06 16:45 ` simark at simark dot ca
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2022-03-06 16:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---

I had to install some system debuginfo (for libstdc++) to get the
watchpoint to parse.  Thanks to debuginfod this was super easy.
After this, on Fedora 34, with git gdb, it seems to work:

(gdb) watch std::ios_base::Init::_S_refcount
Hardware watchpoint 2: std::ios_base::Init::_S_refcount
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /tmp/THR 
Error in re-setting breakpoint 2: No type "ios_base" within class or namespace
"std".
Error in re-setting breakpoint 2: No type "ios_base" within class or namespace
"std".
Error in re-setting breakpoint 2: No type "ios_base" within class or namespace
"std".
Error in re-setting breakpoint 2: No type "ios_base" within class or namespace
"std".
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff7a38640 (LWP 53578)]
[New Thread 0x7ffff7237640 (LWP 53579)]

Thread 2 "THR" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7a38640 (LWP 53578)]
0x00007ffff7ec2b7a in std::ostream::sentry::sentry (this=0x7ffff7a37d20,
__os=...) at
/usr/src/debug/gcc-11.2.1-9.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/ostream.tcc:51
51            if (__os.tie() && __os.good())

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

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

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
                   ` (3 preceding siblings ...)
  2022-03-06 16:37 ` tromey at sourceware dot org
@ 2022-03-06 16:41 ` tromey at sourceware dot org
  2022-03-06 16:45 ` simark at simark dot ca
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2022-03-06 16:41 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I suspect it was fixed by:

commit cd3f655cc7a55437a05aa8e7b1fcc9051b5fe404
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Thu Sep 30 22:38:29 2021 -0400

    gdb: add accessors for field (and call site) location

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

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

* [Bug gdb/27005] ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4
  2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
                   ` (4 preceding siblings ...)
  2022-03-06 16:41 ` tromey at sourceware dot org
@ 2022-03-06 16:45 ` simark at simark dot ca
  5 siblings, 0 replies; 7+ messages in thread
From: simark at simark dot ca @ 2022-03-06 16:45 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Simon Marchi <simark at simark dot ca> ---
I tried it again on the same system on which I could reproduce back then, and
it works fine now.

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

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

end of thread, other threads:[~2022-03-06 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 23:34 [Bug gdb/27005] New: ../../gdb/gdb/gdbtypes.c:5443: internal-error: Unexpected type field location kind: 4 schwab@linux-m68k.org
2021-03-27 10:10 ` [Bug gdb/27005] " domen.stangar at gmail dot com
2021-03-28  2:08 ` simark at simark dot ca
2021-08-14 19:45 ` tromey at sourceware dot org
2022-03-06 16:37 ` tromey at sourceware dot org
2022-03-06 16:41 ` tromey at sourceware dot org
2022-03-06 16:45 ` simark at simark dot ca

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