public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* segfault in __libc_start_main when compiling f77 and c code together?
@ 2001-01-08 16:25 Britton
  2001-01-08 17:21 ` Toon Moene
  0 siblings, 1 reply; 4+ messages in thread
From: Britton @ 2001-01-08 16:25 UTC (permalink / raw)
  To: gcc

I have asked around to try to determine the cause of this problem and been
told that it often comes up when gcc is used to compile c++ code, so mayby
something like that is going on here?

I have been unable to reproduce this problem in simple test programs using
calling in both directions however.

If anyone knows the likely cause of this and could point me toward the
solution I would really appreciate it.

Britton

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: segfault in __libc_start_main when compiling f77 and c code together?
  2001-01-08 16:25 segfault in __libc_start_main when compiling f77 and c code together? Britton
@ 2001-01-08 17:21 ` Toon Moene
  2001-01-09 17:11   ` Britton
  0 siblings, 1 reply; 4+ messages in thread
From: Toon Moene @ 2001-01-08 17:21 UTC (permalink / raw)
  To: Britton; +Cc: gcc

Britton wrote:

> I have asked around to try to determine the cause of this problem and been
> told that it often comes up when gcc is used to compile c++ code, so mayby
> something like that is going on here?

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.

2. When the calling program is Fortran, are you sure the arrays in the
   main program are not larger than your virtual memory (i.e. RAM+SWAP)

?

-- 
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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: segfault in __libc_start_main when compiling f77 and c code together?
  2001-01-08 17:21 ` Toon Moene
@ 2001-01-09 17:11   ` Britton
  2001-01-10 14:06     ` Toon Moene
  0 siblings, 1 reply; 4+ messages in thread
From: Britton @ 2001-01-09 17:11 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc

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.  We are trying to
migrate away from IBM SP/2 towers.  The C functions use MPI (trying to
move to mpich).  I suspect the problem is related to the MPI calls made in
main, but I havn't been able to duplicat the problem in any smaller test
programs yet, and today I found out that some of the libraries this beast
is linked against are multi threaded, so I suppose that might be
contributing somehow.

However, it does segfault before anything actually happens in main, before
the first MPI calls are made or anything else happens.  It is driving me
nuts that I can't duplicate this on a smaller scale.  What kinds of
linking/library issues might be causing things to die in this way before
anything has even happened?

Britton

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: segfault in __libc_start_main when compiling f77 and c code together?
  2001-01-09 17:11   ` Britton
@ 2001-01-10 14:06     ` Toon Moene
  0 siblings, 0 replies; 4+ messages in thread
From: Toon Moene @ 2001-01-10 14:06 UTC (permalink / raw)
  To: Britton; +Cc: gcc

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-01-10 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-08 16:25 segfault in __libc_start_main when compiling f77 and c code together? Britton
2001-01-08 17:21 ` Toon Moene
2001-01-09 17:11   ` Britton
2001-01-10 14:06     ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).