Bug 645773

Summary: internal-error: print_frame_args: Assertion `nsym != NULL' failed
Product: Red Hat Enterprise Linux 5 Reporter: Mike <mrkfact>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5CC: eam23, ebachalo, juanino, pmuller, rdassen
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.0.1-36.el5 Doc Type: Bug Fix
Doc Text:
The Fortran programming language is case-insensitive. When compiling Fortran programs with Intel Fortran Compiler, the compiler records some debug info symbols in uppercase. The gfortran compiler writes case-insensitive symbols in lowercase. Because of this, GDB could have terminated unexpectedly while accessing uppercase characters in the debug information from the Intel Fortran Compiler. With this update, GDB properly implements case insensitivity and ignores the symbols case in the symbol files.
Story Points: ---
Clone Of:
: 669434 (view as bug list) Environment:
Last Closed: 2011-07-21 07:58:02 UTC Type: ---
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: 590060, 654331, 669434    
Attachments:
Description Flags
Backport for gdb-7.0.1-32.el5.
none
Backport #2 for gdb-7.0.1-32.el5. none

Description Mike 2010-10-22 12:54:28 UTC
Description of problem:
Please see the upstream bug report: http://sourceware.org/bugzilla/show_bug.cgi?id=11313


Version-Release number of selected component (if applicable):
gdb-7.0.1-23.el5_5.2

Comment 2 Jan Kratochvil 2010-11-03 21:30:19 UTC
Created attachment 457591 [details]
Backport for gdb-7.0.1-32.el5.

Backport of the case-sensitivity from upstream for gdb-7.0.1-32.el5.

Reference to the type remains to be resolved.

Why don't you use gfortran?

Comment 5 Mike 2010-11-05 12:12:00 UTC
Jan,

I asked one of our software engineers why gfortran didn't work for them, and this was his response (I can get more accurate details if desired).  It's also worth noting that much of our fortran code base was written on VMS and ported to Linux.

"I no longer remember the exact problems but some of the main ones were:
Much of our code base did NOT compile with gfortran at all (structure.member did not work, structure%member did, all of our code uses the structure.member syntax, longer line lengths were not supported, if I remember correctly) – this is NOT an exhaustive list.
Certain features (POINTERs, structure syntax) were unsupported in gfortran (I don’t remember much about how much interlanguage support there was either)
The compiler options which we used and required possibly did not exist. (we use -132, -no-cxxlib, -noalign, -align records, -warn noalignments, -warn declarations, -warn truncated_source, -warn nousage, -fixed, -assume nounderscore, -fpic (and soon to be used –save))
Run time behavior (if we ever got that far) was different than VMS

I would have to check in more detail but I also believe that our freeform syntax wasn’t well accepted by the compiler either."

Comment 6 Mike 2010-11-05 12:23:31 UTC
gdb-7.0.1-32.el5 isn't available on RHN yet.  Is there a location that I can download the source RPM (or a patched binary RPM) to test the patch?

Comment 7 Jan Kratochvil 2010-11-06 04:56:27 UTC
(In reply to comment #5)
> (structure.member did not work, structure%member did,
> all of our code uses the structure.member syntax,

Filed as: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46327
You would have to file it as a Red Hat customer to get Red Hat attention on it.

Thanks.

> longer line lengths were not supported,

You may need gfortran -ffree-line-length-none but without a reproducer it is difficult to say.

> Certain features (POINTERs, structure syntax) were unsupported in gfortran

POINTERs are supported by gfortran upstream and by Red Hat variant of GDB, for GDB it is a part of the gdb.fortran/dynamic.f90 testcase.


(In reply to comment #6)
> gdb-7.0.1-32.el5 isn't available on RHN yet.  Is there a location that I can
> download the source RPM (or a patched binary RPM) to test the patch?

This is an unsupported preview build only:
http://people.redhat.com/jkratoch/bz645773/

Comment 10 Jan Kratochvil 2010-11-07 03:52:44 UTC
Post upstream:
[patch 1/2] Code cleanup: New init_one_comp_unit
http://sourceware.org/ml/gdb-patches/2010-11/msg00107.html
[patch 2/2] iFort compat.: case insensitive symbols (PR 11313)
http://sourceware.org/ml/gdb-patches/2010-11/msg00108.html
+for HEAD:
[new testcase] Regression 7.1->7.2 for iFort [Re: [RFA-v2] dwarf debug format: Support DW_AT_variable_parameter attribute]
http://sourceware.org/ml/gdb-patches/2010-11/msg00084.html

Comment 11 Jan Kratochvil 2010-11-08 18:12:50 UTC
Created attachment 458840 [details]
Backport #2 for gdb-7.0.1-32.el5.

Comment 13 Mike 2010-11-09 18:53:32 UTC
Jan, we still receive this error with your preview build, and one of our developers has created a simple reproducer, although I'm not sure how useful it is to you since it uses ifort.


Here is the small reproducer:
 
~/if: cat test1.for
       program test1
         call test2('mystring')
       end program test1
       subroutine test2(mystr)
         character *(*) mystr
         type *, "The string is ", mystr
       end subroutine test2
 
Compile and link steps:
 
 ifort -g -c -o test1.o -no-cxxlib -fixed test1.for
 ifort 'test1.o' -L/export/intel/compiler/11.0/081/lib/intel64 -Wl,-rpath,/export/intel/compiler/11.0/081/lib/intel64 -Wl,-E -no-cxxlib -limf -lifcore -o test1
 
Run steps:
$ gdb test1
(gdb) br test2
(gdb) run
 
 
You should get something like this:
Breakpoint 1, test2 (mystr='mystring'
../../gdb/stack.c:289: internal-error: print_frame_args: Assertion `nsym != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Comment 14 Jan Kratochvil 2010-11-09 19:02:21 UTC
I have local iFort installation for the compatibility testing.
Thanks for the reproducer, going to fix it.

Comment 15 Jan Kratochvil 2010-11-10 04:30:24 UTC
The problem reported by Comment 13 is not reproducible for me:

http://people.redhat.com/jkratoch/gdb-7.0.1-32_bz645773.el5.x86_64-demo.tar.gz
(The Intel libraries may not be redistributable this way, I will delete it.)

./gdb-7.0.1-32_bz645773.el5.x86_64 -nx -ex 'set env LD_LIBRARY_PATH=.' -ex 'b test2' -ex r ./test1
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32_bz645773.el5)
Copyright (C) 2009 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/jkratoch/redhat/gdb-7.0.1-32_bz645773.el5.x86_64-demo/test1...(no debugging symbols found)...done.
Breakpoint 1 at 0x402ebb: file test1.for, line 6.
Starting program: /root/jkratoch/redhat/gdb-7.0.1-32_bz645773.el5.x86_64-demo/test1 
[Thread debugging using libthread_db enabled]

Breakpoint 1, test2 (mystr='mystring', .tmp.mystr.len_v$9=8) at test1.for:6
6	test1.for: No such file or directory.
	in test1.for

Comment 16 Mike 2010-11-10 14:34:10 UTC
You're right Jan, the patch does work.  I worked with the developer and realized his was picking up a different gdb in his PATH.  Sorry about that, and thanks for the fix!



(gdb) br test2
Breakpoint 1 at 0x402d77: file test1.for, line 6.
(gdb) run
Starting program: /home/user/xxxxx/fortran/test1
[Thread debugging using libthread_db enabled]

Breakpoint 1, test2 (mystr='mystring', .tmp.mystr.len_v$5=8) at test1.for:6
6                type *, "The string is ", mystr

Comment 20 Mike 2011-02-09 18:46:25 UTC
Jan, we were able to reproduce this error using the patch version of gdb.



~/mf: cat 1.for

       subroutine fortmain

       call minit
       return
       end
      subroutine minit
      call fortmain
      return
      end
~/mf: cat 2.cxx

extern "C" {
int fortmain(void);
}

struct Grid_t {
  Grid_t(void) {}
  ~Grid_t(void) {}
};

struct CFObject {
  CFObject() {}
  ~CFObject() {}
  static void dr(Grid_t &resultGrid) {
   fortmain();
  }
};

int main() {
  CFObject cfo;
  Grid_t gr;
  cfo.dr(gr);
  return 0;
}
~/mf: cat b.sh

ifort -g -c -o 1.o -assume nounderscore 1.for
g++ -g -c -o 2.o 2.cxx
g++ 1.o 2.o -o ./3


 

Steps to reproduce:

~/mf: . b.sh
~/mf: gdb 3
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-24.el5)
Copyright (C) 2009 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/user/emilkie/mf/3...done.

(gdb) br 22
Breakpoint 1: file 2.cxx, line 22.
(gdb) run
Starting program: /home/user/emilkie/mf/3

Breakpoint 1, main () at 2.cxx:22
22        cfo.dr(gr);
(gdb) s
CFObject::dr (resultGrid=...) at 2.cxx:15
15         fortmain();
(gdb)
fortmain () at 1.for:4
4              call minit
(gdb)
minit () at 1.for:8
8             call fortmain
(gdb) bt
#0  minit () at 1.for:8
#1  fortmain () at 1.for:4
#2  CFObject::dr (
../../gdb/stack.c:289: internal-error: print_frame_args: Assertion `nsym != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

Comment 23 Eva Kopalova 2011-04-15 12:55:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The Fortran programming language is case-insensitive. When compiling Fortran programs with Intel Fortran Compiler, the compiler records some debug info symbols in uppercase. The gfortran compiler writes case-insensitive symbols in lowercase. Because of this, GDB could have terminated unexpectedly while accessing uppercase characters in the debug information from the Intel Fortran Compiler. With this update, GDB properly implements case insensitivity and ignores the symbols case in the symbol files.

Comment 25 errata-xmlrpc 2011-07-21 07:58:02 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1024.html