Bug 1076690

Summary: Python Exception <type 'exceptions.IndexError'> list index out of range:
Product: Red Hat Enterprise Linux 7 Reporter: Mark Wielaard <mjw>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Michael Petlan <mpetlan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jakub, jan.kratochvil, law, mcermak, mnewsome, mpetlan, mpolacek, ohudlick, pmuldoon
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: gcc-4.8.5-6.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 06:25:18 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:
Bug Depends On:    
Bug Blocks: 1110700, 1191021    

Description Mark Wielaard 2014-03-14 20:31:58 UTC
Description of problem:

While debugging some Python Exception occurs.


Breakpoint 1, dwarf_builder::build (this=0x11b8a8e0, sess=..., 
Python Exception <type 'exceptions.IndexError'> list index out of range: 
     base=0x11aee390, location=0x119abc70, parameters=std::map with 2 elements, 
     finished_results=std::vector of length 0, capacity 0) at tapsets.cxx:7215
 7215 {

(gdb) set python print-stack full
(gdb) bt
#0  dwarf_builder::build (this=0x11b8a8e0, sess=..., base=0x11aee390, 
    location=0x119abc70, Traceback (most recent call last):
  File "/lib64/../share/gcc-4.8.2/python/libstdcxx/v6/printers.py", line 438, in children
    rep_type = find_type(self.val.type, '_Rep_type')
  File "/lib64/../share/gcc-4.8.2/python/libstdcxx/v6/printers.py", line 52, in find_type
    field = typ.fields()[0]
IndexError: list index out of range
parameters=
std::map with 2 elements, finished_results=std::vector of length 0, capacity 0)
    at tapsets.cxx:7215


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

gdb-7.6.1-51.el7.ppc64
gcc-4.8.2-15.el7.ppc64

Comment 2 RHEL Program Management 2014-03-22 05:47:46 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Martin Sebor 2015-02-26 18:02:28 UTC
Here's a small test case:

$ cat t.cpp && gdb -batch -q -ex "b foo" -ex "set python print-stack full" -ex "run" -ex "bt" a.out 
#include <map>

typedef std::map<int, void*> M;

M::size_type foo (M &m)
{
    return m.size ();
}

int main (void) {
    M m;

    m[1] = (void*)1;

    foo (m);
}
Breakpoint 1 at 0x10000a1c: file t.cpp, line 7.

Breakpoint 1, foo (m=Traceback (most recent call last):
  File "/lib64/../share/gcc-4.8.3/python/libstdcxx/v6/printers.py", line 482, in children
    rep_type = find_type(self.val.type, '_Rep_type')
  File "/lib64/../share/gcc-4.8.3/python/libstdcxx/v6/printers.py", line 96, in find_type
    field = typ.fields()[0]
IndexError: list index out of range
std::map with 1 elements) at t.cpp:7
7	    return m.size ();
#0  foo (m=Traceback (most recent call last):
  File "/lib64/../share/gcc-4.8.3/python/libstdcxx/v6/printers.py", line 482, in children
    rep_type = find_type(self.val.type, '_Rep_type')
  File "/lib64/../share/gcc-4.8.3/python/libstdcxx/v6/printers.py", line 96, in find_type
    field = typ.fields()[0]
IndexError: list index out of range
std::map with 1 elements) at t.cpp:7
#1  0x0000000010000ab0 in main () at t.cpp:15

Comment 6 Martin Sebor 2015-02-26 18:12:09 UTC
I should have mentioned that the problem can be reproduced on both ppc64 and ppc64le with the stock RHEL 7.1 GCC (with no special options other than -g) and GDB. I couldn't reproduce it on Fedora 21 x86_64 with the stock tool chain and I am yet to try RHEL 7.1 x86_64.

Comment 7 Martin Sebor 2015-02-26 21:40:49 UTC
The same problem can be reproduced on RHEL 7.1 x86_64.  It's fixed by libstdc++ commit df1ac917c9ce90beb8c3804c2d92cb47b337de30 upstream.  The relevant bugs are GDB/15195 and libstdc++/53477.

Comment 9 Martin Sebor 2016-05-02 15:02:42 UTC
The bug affects other targets besides powerpc.

Comment 11 Michael Petlan 2016-07-25 09:31:47 UTC
test fails with gcc-4.8.5-4.el7
test passes for gcc-4.8.5-9.el7

VERIFIED

Comment 13 errata-xmlrpc 2016-11-04 06:25:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2433.html