Bug 1976887

Summary: ../../gdb/gdbtypes.c:5438: internal-error: Unexpected type field location kind: 4
Product: [Fedora] Fedora Reporter: Jonathan Wakely <jwakely>
Component: gdbAssignee: Alexandra Petlanová Hájková <ahajkova>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: ahajkova, fweimer, gilboad, jan, jan.kratochvil, keiths, kevinb, mcermak, pmuldoon, sergiodj
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gdb-10.2-6.fc34 gdb-10.2-9.fc35 gdb-10.2-3.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-01 00:14:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Wakely 2021-06-28 13:09:33 UTC
Description of problem:

GDB crashes when debugging C++ programs.

Version-Release number of selected component (if applicable):

gdb-10.2-3.fc34.x86_64



How reproducible:

Always

Steps to Reproduce:
Compile this code with g++ -g sb.C (using any recent GCC, although the line 221 used below is for Fedora's default compiler, gcc-c++-11.1.1-3.fc34):

#include <sstream>
#include <stdio.h>

int main()
{
  std::istringstream in(" abc");
  std::ostringstream out;
  in >> out.rdbuf();
  puts(out.str().c_str());
}

Then run:

gdb -q  -ex start -ex n -ex n -ex step -ex finish -ex step -ex n -ex "br 221" -ex r a.out

It crashes:

Reading symbols from a.out...
Temporary breakpoint 1 at 0x4022f2: file sb.cc, line 6.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at sb.cc:6
6         std::istringstream in(" abc");
7         std::ostringstream out;
8         in >> out.rdbuf();
std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::rdbuf (this=0x7fffffffd400)
    at /usr/src/debug/gcc-11.1.1-3.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/sstream:908
908           rdbuf() const
Run till exit from #0  std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::rdbuf (this=0x7fffffffd400)
    at /usr/src/debug/gcc-11.1.1-3.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/sstream:908
0x0000000000402364 in main () at sb.cc:8
8         in >> out.rdbuf();
Value returned is $1 = (std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::__stringbuf_type *) 0x7fffffffd408
std::istream::operator>> (this=0x7fffffffd580, __sbout=0x7fffffffd408)
    at /usr/src/debug/gcc-11.1.1-3.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/istream.tcc:211
211         basic_istream<_CharT, _Traits>::
734           operator bool() const
Breakpoint 2 at 0x7ffff7e3ec40: /usr/src/debug/gcc-11.1.1-3.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/istream:221. (8 locations)
The program being debugged has been started already.
Start it from the beginning? (y or n) y
../../gdb/gdbtypes.c:5438: 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:5438: 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) n

Comment 1 Gilboa Davara 2021-08-11 13:32:01 UTC
Seeing the same on multiple machines.
Possibly related to this (1) bug?

1) https://sourceware.org/bugzilla/show_bug.cgi?id=28030

Comment 2 Jonathan Wakely 2021-08-11 13:33:04 UTC
Yes, that's why it's linked (see above).

Comment 3 Jonathan Wakely 2021-08-11 13:34:23 UTC
(and that bug is an exact copy of my original submission here)

Comment 4 Fedora Update System 2021-09-29 09:56:48 UTC
FEDORA-2021-c4ca5ef0d3 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-c4ca5ef0d3

Comment 5 Fedora Update System 2021-09-30 01:43:08 UTC
FEDORA-2021-c4ca5ef0d3 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-c4ca5ef0d3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-c4ca5ef0d3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-09-30 10:43:00 UTC
FEDORA-2021-ac6363ae65 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-ac6363ae65

Comment 7 Jonathan Wakely 2021-09-30 11:35:26 UTC
Thanks!

Comment 8 Fedora Update System 2021-10-01 00:14:52 UTC
FEDORA-2021-c4ca5ef0d3 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2021-10-01 02:21:35 UTC
FEDORA-2021-ac6363ae65 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-ac6363ae65`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-ac6363ae65

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Gilboa Davara 2021-10-13 14:53:44 UTC
Thanks!

Comment 11 Fedora Update System 2021-10-15 18:53:38 UTC
FEDORA-2021-ac6363ae65 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.