ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Crash at startup of DDD for Fortran programs


From: Peter Wainwright
Subject: Re: Re: Crash at startup of DDD for Fortran programs
Date: Thu, 18 Dec 2008 17:08:14 +0000

A couple of other points I found out:

(1) The problem I had in 2005 had the same symptoms, but it seems it was
related to a Red Hat (Fedora) patch, not found on upstream GDB.  So,
unless Mandriva made the same changes, it is probably not the same issue
and my patch won't help you.

(2) Reading your original message more carefully I understand why when
you saw the "segmentation fault" message might have concluded that DDD
had crashed. That was my first thought, too. However, reading the error
message more carefully you can see it says that "*GDB* terminated
abnormally (Segmentation fault)".  DDD also issues dialogs if it
crashes, but they look slightly different:

             DDD: Oops
Internal error: Segmentation fault (core dumped)
Restart    Exit    Ignore    Help

In fact DDD is taking the only action it can in the desperate situation
when its inferior debugger has vanished.

(3) The problem is most likely due to some error in gdb when you use
"info line xx" to query a symbol which does not exist. I believe that
DDD is trying to find the source line corresponding to the program entry
point so it can display it in the source view window. However, each
language creates a different symbol for the entry point: C programs, as
we know, call it "main"; Fortran programs call it "MAIN__". Therefore,
DDD tries a series of different names until it finds one which works.
For example, if I try it on your program:

address@hidden:tmp$ gdb a.out
GNU gdb 6.8-debian
Copyright (C) 2008 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-gnu"...
(gdb) info line main
No line number information available for address 0x400860 <main>
(gdb) info line MAIN__
Line 1 of "plouf.f" starts at address 0x4007b8 <MAIN__> and ends at
0x4007c3 <MAIN__+11>.

It looks like instead of saying "No line number information" your GDB is
crashing on the underined symbol.

Hope this helps,

Peter


On Thu, 2008-12-18 at 14:55 +0000, address@hidden wrote:
> I notice you are using gdb 6.3.
> 
> There definitely was a problem with GDB on some distributions, back in
> 2005:
> 
> http://osdir.com/ml/gdb.bugs.discuss/2005/msg00322.html
> http://sourceware.org/ml/gdb/2005-10/msg00078.html
> https://bugzilla.redhat.com/show_bug.cgi?id=164150
> 
> I submitted a GDB patch on the Red Hat bugzilla, but Fedora moved to a
> later upstream version and the bug went away anyway.
> 
> 
> I've attached the patch if you want to try to fix your GDB.
> 
> 
> Peter
> 
> On Thu Dec 18 11:41 , GUEZ Lionel sent:
> 
> 
> 
>         > On Wed, 2008-12-17 at 14:40 +0100, GUEZ Lionel wrote:
>         > > Hello. DDD displays an error at startup when I use it on
>         any Fortran
>         > > program. Here is a test on a two-line program :
>         > >
>         > > $ cat plouf.f
>         > > print *, "plouf"
>         > > end
>         > >
>         > > $ gfortran -g -O0 plouf.f
>         > >
>         > > $ ddd a.out
>         > >
>         > > The DDD console opens with the following message :
>         > >
>         > > "GNU DDD 3.3.11 (i586-mandriva-linux-gnu), by Dorothea
>         LÃtkehaus and
>         > > Andreas Zeller.
>         > > Copyright  1995-1999 Technische UniversitÃt Braunschweig,
>         Germany.
>         > > Copyright  1999-2001 UniversitÃt Passau, Germany.
>         > > Copyright  2001 UniversitÃt des Saarlandes, Germany.
>         > > Copyright  2001-2004 Free Software Foundation, Inc.
>         > > Using host libthread_db library
>         "/lib/i686/libthread_db.so.1".
>         > > (gdb)
>         > > Segmentation fault"
>         > >
>         > > and two dialog boxes appear saying :
>         > >
>         > > "GDB terminated abnormally (Segmentation fault)"
>         >
>         > ^
>         > This line says that GDB (the line-oriented debugger
>         underneath DDD)
>         > terminated abnormally, which it should not do. It may be
>         that DDD has
>         > told it do do something silly (using too much memory for
>         example), but
>         > in an ideal world no program should ever crash on any input.
>         You can
>         > find out what commands have been sent to GDB by examining
>         ~/.ddd/log and
>         > looking for the lines which begin with "->". If I were you I
>         would try
>         > debugging your program with gdb directly. By repeating these
>         commands in
>         > GDB you may be able to replicate the crash, and then you can
>         send a bug
>         > report to the GDB maintainers.
>         >
>         > Peter Wainwright
>         >
>         > > "/libgfortran/fmain.c: No such file or directory"
>         > >
>         > > Does anyone have a suggestion?
>         > > Sincerely,
>         > > Lionel GUEZ
>         
>         Hello. Thank you for your answer. Again, the test Fortran
>         program I am using 
>         has the following two lines:
>         
>         print *, "plouf"
>         end
>         
>         That is all and that is enough to crash DDD. This Fortran
>         program does not 
>         require much memory!
>         
>         Please find enclosed the file ".ddd/log" created after the
>         crash. I do not 
>         understand the error messages in that file.
>         
>         Finally, I have tried running GDB directly on the same
>         program. It works fine:
>         
>         ---------------------------------
>         $ gdb a.out
>         GNU gdb 6.3-8mdv2007.0 (Mandriva Linux release 2007.0)
>         Copyright 2004 Free Software Foundation, Inc.
>         GDB is free software, covered by the GNU General Public
>         License, and you are
>         welcome to change it and/or distribute copies of it under
>         certain conditions.
>         Type "show copying" to see the conditions.
>         There is absolutely no warranty for GDB. Type "show warranty"
>         for details.
>         This GDB was configured as "i586-mandriva-linux-gnu"...Using
>         host libthread_db 
>         library "/lib/i686/libthread_db.so.1".
>         
>         (gdb) run
>         Starting program: /usr/local/guez/a.out
>         Reading symbols from shared object read from target
>         memory...done.
>         Loaded system supplied DSO at 0xbfffe000
>         plouf
>         
>         Program exited normally.
>         (gdb) quit
>         ---------------------------------
>         
>         So the problem really lies with DDD.
>         
>         Can you not reproduce the crash with my two-line program?
>         Sincerely,
>         Lionel GUEZ
> 
>  
> 
> 
> _______________________________________________
> ddd mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/ddd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]