This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: segfault in __libc_start_main when compiling f77 and c code together?
- To: Britton <fsblk at aurora dot uaf dot edu>
- Subject: Re: segfault in __libc_start_main when compiling f77 and c code together?
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 10 Jan 2001 21:48:35 +0100
- CC: gcc at gcc dot gnu dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <Pine.OSF.4.31.0101091536490.23078-100000@aurora.uaf.edu>
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)