Bug 508406 - Assertion failed in gdb gdb/gdbtypes.c:3135: internal-error: copy_type_recursive_1
Summary: Assertion failed in gdb gdb/gdbtypes.c:3135: internal-error: copy_type_recurs...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 11
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 516995
TreeView+ depends on / blocked
 
Reported: 2009-06-26 22:12 UTC by Tim Scofield
Modified: 2009-09-01 13:36 UTC (History)
3 users (show)

Fixed In Version: 6.8.50.20090302-38.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-28 22:53:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Tim Scofield 2009-06-26 22:12:02 UTC
Description of problem:
../../gdb/gdbtypes.c:3135: internal-error: copy_type_recursive_1: Assertion `TYPE_OBJFILE (type) == objfile' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Version-Release number of selected component (if applicable):
gdb-6.8.50.20090302-27.fc11.x86_64

How reproducible:
very

Steps to Reproduce:
(gdb) list
77      C
78            NZERO = 0
79            SMOD  = 1. / SSFT**2
80            NEXO = 0
81            TLEFT = TEND - TIME
82            NERR = 0
83            IF( NSTEPS .EQ. 0 ) THEN
84      C
85      C Calculate acceleration corrections to enforce kinematic constraints
86      C on initial velocities -
(gdb) step
79            SMOD  = 1. / SSFT**2
(gdb) print ssft
$1 = 1
(gdb) whatis ssft
type = real(kind=8)
(gdb) step
22            SUBROUTINE SOLVE( NSTEPS,KOUT,KPLOT,NODWR,NELWR,NSVLST,NVARHI,
(gdb) step
79            SMOD  = 1. / SSFT**2
(gdb) step
22            SUBROUTINE SOLVE( NSTEPS,KOUT,KPLOT,NODWR,NELWR,NSVLST,NVARHI,
(gdb)

  
Wondering if this is really a gdb problem or a gfortan/gcc issue.

Comment 1 Tim Scofield 2009-06-29 04:33:41 UTC
Looks like a problem with my makefiles and how compiler options are passed.

Comment 2 Jan Kratochvil 2009-07-01 16:11:59 UTC
GDB must not crash with internal error on any input. Moreover I am very interested in this part as the assertion is in a Fedora-only Fortran allocated arrays support.

Is it possible to provide a reproducer?  Thanks.

Comment 3 Tim Scofield 2009-07-01 16:56:08 UTC
Background:

I believe I'm having problems with the C memory management routines for some old F77 code, and based on what's happening when stepping through the debugger above, I'm guessing that the memory management routines have overwritten some of the code execution text. 

I doubt that it makes much sense to pursue this error further, but if you're still interested in a reproducer I'll see what I can do. It may take a while.

Comment 4 Jan Kratochvil 2009-07-01 17:11:47 UTC
This error comes from the reading of the DWARF info, one should not be able to corrupt this information by the debuggee runtime code, no matter how well one tries to.

Yes, I am still interested in a reproducer, if it is feasible.

Comment 5 Orion Poplawski 2009-07-15 22:01:33 UTC
I'm seeing the same error.  Steps to reproduce:

- F11 32-bit system, current with updates-testing
- Build hdf from the current srpm, the build will fail during the tests
- cd HDF4.2r4/hdf/test
- gdb ./fortestF
(gdb) run       
Starting program: /export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF
 ===========================================  
 HDF Library Fortran Interface Tests Started    
 ===========================================
Built with HDF Library Version: 4.2r4                   
HDF Version 4.2 Release 4, January 25, 2009                             
 Testing -- slab                                                           
 Testing -- r24                                                          
 Testing -- an                                            
*** stack smashing detected ***: /export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF terminated                                         
======= Backtrace: =========                        
/lib/libc.so.6(__fortify_fail+0x48)[0x7b5bd8]         
/lib/libc.so.6(__fortify_fail+0x0)[0x7b5b90]
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x8059495]
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x8059c87]
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x804ba94]
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x804c560]
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x80d10fb]
/lib/libc.so.6(__libc_start_main+0xe6)[0x6d4a66]   
/export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF[0x804a1b1]
======= Memory map: ========            
0069a000-006ba000 r-xp 00000000 08:02 1509       /lib/ld-2.10.1.so    
006ba000-006bb000 r--p 0001f000 08:02 1509       /lib/ld-2.10.1.so      
006bb000-006bc000 rw-p 00020000 08:02 1509       /lib/ld-2.10.1.so  
006be000-00829000 r-xp 00000000 08:02 10431      /lib/libc-2.10.1.so
00829000-0082a000 ---p 0016b000 08:02 10431      /lib/libc-2.10.1.so  
0082a000-0082c000 r--p 0016b000 08:02 10431      /lib/libc-2.10.1.so       
0082c000-0082d000 rw-p 0016d000 08:02 10431      /lib/libc-2.10.1.so   
0082d000-00830000 rw-p 0082d000 00:00 0              
00832000-00858000 r-xp 00000000 08:02 10735      /lib/libm-2.10.1.so      
00858000-00859000 r--p 00025000 08:02 10735      /lib/libm-2.10.1.so  
00859000-0085a000 rw-p 00026000 08:02 10735      /lib/libm-2.10.1.so
00880000-00892000 r-xp 00000000 08:02 10445      /lib/libz.so.1.2.3
00892000-00893000 rw-p 00011000 08:02 10445      /lib/libz.so.1.2.3
00a27000-00af4000 r-xp 00000000 08:02 17609      /usr/lib/libgfortran.so.3.0.0
00af4000-00af5000 rw-p 000cd000 08:02 17609      /usr/lib/libgfortran.so.3.0.0
00af5000-00af6000 rw-p 00af5000 00:00 0
00b08000-00b32000 r-xp 00000000 08:02 11567      /lib/libgcc_s-4.4.0-20090506.so.1
00b32000-00b33000 rw-p 00029000 08:02 11567      /lib/libgcc_s-4.4.0-20090506.so.1
00fe1000-00fe2000 r-xp 00fe1000 00:00 0          [vdso]
06965000-06986000 r-xp 00000000 08:02 17770      /usr/lib/libjpeg.so.62.0.0
06986000-06987000 rw-p 00021000 08:02 17770      /usr/lib/libjpeg.so.62.0.0
08048000-080e6000 r-xp 00000000 08:02 361556     /export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF
080e6000-080e8000 rw-p 0009e000 08:02 361556     /export/home/orion/fedora/hdf/devel/HDF4.2r4/hdf/test/fortestF
080e8000-08143000 rw-p 080e8000 00:00 0          [heap]
b7fde000-b7fe1000 rw-p b7fde000 00:00 0
bffea000-c0000000 rw-p bffea000 00:00 0          [stack]

Program received signal SIGABRT, Aborted.
0x00fe1416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.10.1-2.i686 libgcc-4.4.0-4.i586 libgfortran-4.4.0-4.i586 libjpeg-6b-45.fc11.i586 zlib-1.2.3-22.fc11.i586
(gdb) bt
#0  0x00fe1416 in __kernel_vsyscall ()
#1  0x006e97c1 in raise () from /lib/libc.so.6
#2  0x006eb092 in abort () from /lib/libc.so.6
#3  0x00727dad in __libc_message () from /lib/libc.so.6
#4  0x007b5bd8 in __fortify_fail () from /lib/libc.so.6
#5  0x007b5b90 in __stack_chk_fail () from /lib/libc.so.6
#6  0x08059495 in an_check_lab_desc (filename=
../../gdb/gdbtypes.c:3135: internal-error: copy_type_recursive_1: Assertion `TYPE_OBJFILE (type) == objfile' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

../../gdb/gdbtypes.c:3135: internal-error: copy_type_recursive_1: Assertion `TYPE_OBJFILE (type) == objfile' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
) at tanf.f:227
#7  0x08059c87 in tanf (number_failed=0) at tanf.f:145
#8  0x0804ba94 in runcmd (cmd=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at fortestF.f:223
#9  0x0804c560 in main () at fortestF.f:60
#10 0x080d10fb in main ()

Comment 6 Jan Kratochvil 2009-08-27 11:49:53 UTC
Fixed (just removed the wrong assertion).
This code is fortunately present now only in the F-11 variant of GDB.

Comment 7 Fedora Update System 2009-08-27 12:06:13 UTC
gdb-6.8.50.20090302-38.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/gdb-6.8.50.20090302-38.fc11

Comment 8 Orion Poplawski 2009-08-27 15:14:47 UTC
Fixes my problem.  Thanks!

Comment 9 Orion Poplawski 2009-08-27 15:15:52 UTC
Although, I do still see this:

#8  0x0804ba94 in runcmd (cmd=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at fortestF.f:223

Comment 10 Fedora Update System 2009-08-27 22:54:30 UTC
gdb-6.8.50.20090302-38.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Jan Kratochvil 2009-08-28 22:53:33 UTC
Thanks, the comment 9 fix is checked-in the archer-jankratochvil-vla branch:
http://sourceware.org/ml/archer/2009-q3/msg00159.html
http://sourceware.org/gdb/wiki/ArcherBranchManagement

(gdb) bt
#0  0x00644430 in __kernel_vsyscall ()
#1  0x004fc7c1 in raise () from /lib/libc.so.6
#2  0x004fe092 in abort () from /lib/libc.so.6
#3  0x0053adad in __libc_message () from /lib/libc.so.6
#4  0x005c8d78 in __fortify_fail () from /lib/libc.so.6
#5  0x005c8d30 in __stack_chk_fail () from /lib/libc.so.6
#6  0x08059495 in an_check_lab_desc (filename='', tag=700, ref=2, label='', desc='', number_failed=0, _filename=64, _label=30, _desc=500) at tanf.f:227
#7  0x08059c87 in tanf (number_failed=0) at tanf.f:145
#8  0x0804ba94 in runcmd (cmd='Test', ' ' <repeats 11 times>, param='an', ' ' <repeats 28 times>, retcode=0, _cmd=15, _param=30) at fortestF.f:223
#9  0x0804c560 in main () at fortestF.f:60
#10 0x080d10fb in main ()


It will be present soon in Rawhide=F12 GDB.

When/whether it will get fixed in F11 GDB I am not sure, optimized code debugging in general should be better supported first in F-12, such as by:
http://gcc.gnu.org/wiki/Var_Tracking_Assignments


Note You need to log in before you can comment on or make changes to this bug.