Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Strange "Segmentation fault (core dumped)" error.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tianyf@gmail.com  
View profile  
 More options Jan 10, 9:10 am
Newsgroups: comp.lang.fortran
From: "tia...@gmail.com" <tia...@gmail.com>
Date: Sat, 10 Jan 2009 06:10:32 -0800 (PST)
Local: Sat, Jan 10 2009 9:10 am
Subject: Strange "Segmentation fault (core dumped)" error.
I had been bothered with a "Segmentation fault (core dumped)" error in
the past few days. When insert more array definition in the
subroutine, the program will exit with an error.

The main program (test.f) is
      program test
      character*1023 file
      character*20 dtype
      integer nlat,nlon,ntim
      real d(600,1440,12)

      file='anything.txt'
      dtype='test'

      nlat=600
      nlon=1440
      ntim=12
      call rdnc(file,dtype,d,nlat,nlon,ntim)

      end

The subroutine (rdnc.f) is
      subroutine rdnc(file,dtype,d,nlat,nlon,ntim)
      character*(*) file,dtype
      integer nlat,nlon,ntim
      real d(nlat,nlon,ntim)
c      real d2(nlat,nlon,ntim)

      write(*,*) file
c     ...

      end

When  uncomment the d2 array definition line, the program reports an
error:
[tianyf@tyf error.parameters]$ ifort rdnc.f test.f -o test && ./test
Segmentation fault (core dumped)

I use Intel Fortran Compiler for Linux version 10.1 and run in redhat
linux 9.0.
[tianyf@tyf error.parameters]$ uname -a
Linux tyf 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/
Linux
[tianyf@tyf error.parameters]$

I has 2GB RAM and 512 MB swap space, thus I think this error is not
related to memory capacity. Could someone get me out of the problem?

Cheers,
Tian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
michaelmetc...@compuserve.com  
View profile  
 More options Jan 10, 9:48 am
Newsgroups: comp.lang.fortran
From: michaelmetc...@compuserve.com
Date: Sat, 10 Jan 2009 06:48:10 -0800 (PST)
Local: Sat, Jan 10 2009 9:48 am
Subject: Re: Strange "Segmentation fault (core dumped)" error.
On Jan 10, 3:10 pm, "tia...@gmail.com" <tia...@gmail.com> wrote:

You need to increase your default stack size, I'm sure. (You have the
space, but the compiler does not necessarily allow access to all of
without your telling it.)

Regards,

Mike Metcalf


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tianyf@gmail.com  
View profile  
 More options Jan 10, 10:35 am
Newsgroups: comp.lang.fortran
From: "tia...@gmail.com" <tia...@gmail.com>
Date: Sat, 10 Jan 2009 07:35:43 -0800 (PST)
Local: Sat, Jan 10 2009 10:35 am
Subject: Re: Strange "Segmentation fault (core dumped)" error.
On Jan 10, 10:48 pm, michaelmetc...@compuserve.com wrote:

Yeah, it is about the stack size. After set it to infinite (in CSH:
unlimit stacksize), the program runs successfully now.
:)

Cheers,
Tian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google