This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g77 problems


Nichols Romero wrote:

> I hope I'm sending this to the correct mailing list.

Yep, gcc-help is OK.

> I have a standard i386 RH 6.2 installation which I later applied the
> libf2c rpm to.

That doesn't conflict, because the g77 run time library is called
libg2c.a these days.

> I have a Fortran 77 code which is core dumping; I think
> there is a library file missing. Perhaps one of you has some insight?
> 
> I ran gdb on the core dump file and this is what I got
> 
> Reading symbols from /lib/libc.so.6...done.
> Reading symbols from /lib/ld-linux.so.2...done.
> #0  f_setarg (argc=1, argv=0xbffff984) at ../../../../libf2c/libF77/setarg.c:27
> 27      ../../../../libf2c/libF77/setarg.c: No such file or directory.

setarg.c is not missing - it's just that gdb can't find it, because you
didn't build g77 from source (but installed it from an RPM).

The reason for the core dump in f_setarg is probably that you use arrays
that take up memory larger than you RAM + SWAP virtual memory:

$ cat large.f
      program aap
      real a(40000000)
      a(1) = 1.0
      print*,a(1)
      end
$ g77 large.f
$ gdb ./a.out
GNU gdb 4.17.m68k.objc.threads.hwwp.fpu.gnat
Copyright 1998 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 "i486-pc-linux-gnu"...
(gdb) run
Starting program: /home/toon/g77-bugs/./a.out 

Program received signal SIGSEGV, Segmentation fault.
f_setarg (argc=1, argv=0xbffffd34)
    at ../../../../egcs/libf2c/libF77/setarg.c:27
27      f__xargc = argc;

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]