This is the mail archive of the gcc@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: segfault in __libc_start_main when compiling f77 and c code together?


Britton wrote:

> On Tue, 9 Jan 2001, Toon Moene wrote:
> 
> > Perhaps you could answer some questions related to this problem:
> >
> > 1. Which language is providing the main program - i.e. is it a Fortran
> >    program calling C routines or vice versa.
> 
> Its about as convoluted a setup as I've ever seen.  main is in C, and
> calls a combination of functions in C and fortran.

> However, it does segfault before anything actually happens in main, 

This is a sure sign there's something wrong with the amount of
statically allocated storage (large arrays in Fortran or static stuff in
C) as compared to the total RAM+SWAP memory on your computer.

E.g.:

toon@laptop:~/g77-bugs$ cat huge.f
      program huge
      real a(40 000 000)
      end
toon@laptop:~/g77-bugs$ g77 huge.f
toon@laptop:~/g77-bugs$ ./a.out
Segmentation fault

(my laptop has 64 Mbyte of RAM and 90 Mbyte of SWAP space).

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join 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]