Re: Re: Crash at startup of DDD for Fortran programs
| Newsgroups | gmane.comp.debugging.ddd.general |
|---|---|
| Message-ID | <[email protected]> |
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 [email protected] http://lists.gnu.org/mailman/listinfo/ddd
gdbsegfault.patch
(application/octet-stream, 950 B)
diff -U3 -r gdb-6.3-old/gdb/symtab.c gdb-6.3/gdb/symtab.c
--- gdb-6.3-old/gdb/symtab.c 2005-10-26 09:34:24.000000000 +0100
+++ gdb-6.3/gdb/symtab.c 2005-10-26 12:21:52.000000000 +0100
@@ -2420,16 +2420,16 @@
struct symtab_and_line found_sal;
startaddr = sal.pc;
- if (startaddr == 0
- && !find_line_pc (sal.symtab, sal.line, &pc_list, &num_pc_values))
- return 0;
-
- /* FIXME: have to handle ctors/dtors where line equates to multiple
- pc ranges. */
- if (startaddr == 0)
+ if (startaddr == 0) {
+ if (!find_line_pc (sal.symtab, sal.line, &pc_list, &num_pc_values))
+ return 0;
+
+ /* FIXME: have to handle ctors/dtors where line equates to multiple
+ pc ranges. */
startaddr = pc_list[0];
- xfree (pc_list);
+ xfree (pc_list);
+ }
/* This whole function is based on address. For example, if line 10 has
two parts, one from 0x100 to 0x200 and one from 0x300 to 0x400, then