Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Your good nature will bring unbounded happiness.


devel / comp.lang.fortran / Segmentation Fault error

SubjectAuthor
* Segmentation Fault errorPramod Yadava
+- Re: Segmentation Fault errorThomas Koenig
+- Re: Segmentation Fault errorRobin Vowels
`* Re: Segmentation Fault errorLynn McGuire
 `* Re: Segmentation Fault errorThomas Koenig
  `* Re: Segmentation Fault errorRobin Vowels
   `* Re: Segmentation Fault errorRon Shepard
    +- Re: Segmentation Fault errorgah4
    `* Re: Segmentation Fault errorThomas Koenig
     +* Re: Segmentation Fault errorRon Shepard
     |`- Re: Segmentation Fault errorgah4
     `* Re: Segmentation Fault errorRobin Vowels
      `* Re: Segmentation Fault errorgah4
       +- Re: Segmentation Fault errorGeorge Schroeder
       +- Re: Segmentation Fault errorRobin Vowels
       `* Re: Segmentation Fault errorThomas Koenig
        `- Re: Segmentation Fault errorgah4

1
Segmentation Fault error

<8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2899&group=comp.lang.fortran#2899

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:2601:b0:6bc:70bb:c56b with SMTP id z1-20020a05620a260100b006bc70bbc56bmr6827122qko.416.1663404667316;
Sat, 17 Sep 2022 01:51:07 -0700 (PDT)
X-Received: by 2002:a05:620a:10bc:b0:6ce:4169:7bcc with SMTP id
h28-20020a05620a10bc00b006ce41697bccmr6860463qkk.732.1663404667136; Sat, 17
Sep 2022 01:51:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 17 Sep 2022 01:51:06 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=117.211.192.25; posting-account=JbxjzwoAAACLupFBv1JbCLx9camzETOl
NNTP-Posting-Host: 117.211.192.25
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
Subject: Segmentation Fault error
From: pkindia002@gmail.com (Pramod Yadava)
Injection-Date: Sat, 17 Sep 2022 08:51:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1230
 by: Pramod Yadava - Sat, 17 Sep 2022 08:51 UTC

Respected sir,
i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.

Regards
Pramod
IESD BHU

Re: Segmentation Fault error

<tg422p$5q64$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2900&group=comp.lang.fortran#2900

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Sat, 17 Sep 2022 08:55:53 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tg422p$5q64$1@newsreader4.netcologne.de>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
Injection-Date: Sat, 17 Sep 2022 08:55:53 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:1257:0:7285:c2ff:fe6c:992d";
logging-data="190660"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sat, 17 Sep 2022 08:55 UTC

Pramod Yadava <pkindia002@gmail.com> schrieb:
> Respected sir,
> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.

Depends on your compiler.

If you use gfortran, compile with the options "-g -fcheck=all" and see
what errors you get. Other compilers have similar options.

This may already pinpoint the problem. If not, there are a few
other things to try.

Re: Segmentation Fault error

<fb75ba2b-e30f-4265-bbbc-c913a97264e9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2902&group=comp.lang.fortran#2902

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1986:b0:343:225d:f9e1 with SMTP id u6-20020a05622a198600b00343225df9e1mr7996375qtc.651.1663414863195;
Sat, 17 Sep 2022 04:41:03 -0700 (PDT)
X-Received: by 2002:ac8:7089:0:b0:35b:b5fa:5e35 with SMTP id
y9-20020ac87089000000b0035bb5fa5e35mr7745496qto.449.1663414863064; Sat, 17
Sep 2022 04:41:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 17 Sep 2022 04:41:02 -0700 (PDT)
In-Reply-To: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fb75ba2b-e30f-4265-bbbc-c913a97264e9n@googlegroups.com>
Subject: Re: Segmentation Fault error
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Sat, 17 Sep 2022 11:41:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1528
 by: Robin Vowels - Sat, 17 Sep 2022 11:41 UTC

On Saturday, September 17, 2022 at 6:51:08 PM UTC+10, Pramod Yadava wrote:
> Respected sir,
> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
..
You need to provide the code.
..
Your request is like "My car won't start. What's wrong with it?"

Re: Segmentation Fault error

<tg635l$1hi$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2905&group=comp.lang.fortran#2905

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!mdf2aNOb2oCHynmZpuX5uw.user.46.165.242.91.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Sat, 17 Sep 2022 22:26:44 -0500
Organization: Aioe.org NNTP Server
Message-ID: <tg635l$1hi$1@gioia.aioe.org>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="1586"; posting-host="mdf2aNOb2oCHynmZpuX5uw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Lynn McGuire - Sun, 18 Sep 2022 03:26 UTC

On 9/17/2022 3:51 AM, Pramod Yadava wrote:
> Respected sir,
> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
>
>
> Regards
> Pramod
> IESD BHU

You need to run the code through a debugger and see where the segfault
is being generated.

One of the most common issues is overrunning a local array:

double precision x (10)
....
x (11) = 11.0

That will get you almost any time.

Lynn

Re: Segmentation Fault error

<tg90ul$93c0$2@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2917&group=comp.lang.fortran#2917

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Mon, 19 Sep 2022 06:07:17 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tg90ul$93c0$2@newsreader4.netcologne.de>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org>
Injection-Date: Mon, 19 Sep 2022 06:07:17 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:1257:0:7285:c2ff:fe6c:992d";
logging-data="298368"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Mon, 19 Sep 2022 06:07 UTC

Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> On 9/17/2022 3:51 AM, Pramod Yadava wrote:
>> Respected sir,
>> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
>>
>>
>> Regards
>> Pramod
>> IESD BHU
>
> You need to run the code through a debugger and see where the segfault
> is being generated.
>
> One of the most common issues is overrunning a local array:
>
> double precision x (10)
> ...
> x (11) = 11.0
>
> That will get you almost any time.

$ cat double.f90
program memain
real, dimension(10) :: a
do i=1,11
a(i) = 0.0
end do
end program memain
$ gfortran double.f90
double.f90:4:7:

3 | do i=1,11
| 2
4 | a(i) = 0.0
| 1
Warning: Array reference at (1) out of bounds (11 > 10) in loop beginning at (2)

(Well, it works for statically declared arrays, anyway).

Re: Segmentation Fault error

<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2918&group=comp.lang.fortran#2918

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:1997:b0:6ce:627e:8b2c with SMTP id bm23-20020a05620a199700b006ce627e8b2cmr11907484qkb.376.1663570174528;
Sun, 18 Sep 2022 23:49:34 -0700 (PDT)
X-Received: by 2002:ad4:5f0d:0:b0:4ac:b90b:8275 with SMTP id
fo13-20020ad45f0d000000b004acb90b8275mr13384938qvb.46.1663570174291; Sun, 18
Sep 2022 23:49:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 18 Sep 2022 23:49:34 -0700 (PDT)
In-Reply-To: <tg90ul$93c0$2@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
Subject: Re: Segmentation Fault error
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Mon, 19 Sep 2022 06:49:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2666
 by: Robin Vowels - Mon, 19 Sep 2022 06:49 UTC

On Monday, September 19, 2022 at 4:07:20 PM UTC+10, Thomas Koenig wrote:
> Lynn McGuire <lynnmc...@gmail.com> schrieb:
> > On 9/17/2022 3:51 AM, Pramod Yadava wrote:
> >> Respected sir,
> >> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
> >>
> >>
> >> Regards
> >> Pramod
> >> IESD BHU
> >
> > You need to run the code through a debugger and see where the segfault
> > is being generated.
> >
> > One of the most common issues is overrunning a local array:
> >
> > double precision x (10)
> > ...
> > x (11) = 11.0
> >
> > That will get you almost any time.
> $ cat double.f90
> program memain
> real, dimension(10) :: a
> do i=1,11
> a(i) = 0.0
> end do
> end program memain
> $ gfortran double.f90
> double.f90:4:7:
>
> 3 | do i=1,11
> | 2
> 4 | a(i) = 0.0
> | 1
> Warning: Array reference at (1) out of bounds (11 > 10) in loop beginning at (2)
>
> (Well, it works for statically declared arrays, anyway).
..
This is easy enough to do at compile time, as the violation occurs
in the same procedure as the declaration with explicit bounds.
It becomes more difficult when the declaration is in another
procedure. The diagnosis in such cases is then typically required at
run time (and, in particular, when the bounds are dynamically generated).

Re: Segmentation Fault error

<wG_VK.220902$PRW4.17486@fx11.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2919&group=comp.lang.fortran#2919

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx11.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.2.2
Subject: Re: Segmentation Fault error
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 55
Message-ID: <wG_VK.220902$PRW4.17486@fx11.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Mon, 19 Sep 2022 09:05:16 -0500
X-Received-Bytes: 2944
 by: Ron Shepard - Mon, 19 Sep 2022 14:05 UTC

On 9/19/22 1:49 AM, Robin Vowels wrote:
> On Monday, September 19, 2022 at 4:07:20 PM UTC+10, Thomas Koenig wrote:
>> Lynn McGuire <lynnmc...@gmail.com> schrieb:
>>> On 9/17/2022 3:51 AM, Pramod Yadava wrote:
>>>> Respected sir,
>>>> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
>>>>
>>>>
>>>> Regards
>>>> Pramod
>>>> IESD BHU
>>>
>>> You need to run the code through a debugger and see where the segfault
>>> is being generated.
>>>
>>> One of the most common issues is overrunning a local array:
>>>
>>> double precision x (10)
>>> ...
>>> x (11) = 11.0
>>>
>>> That will get you almost any time.
>> $ cat double.f90
>> program memain
>> real, dimension(10) :: a
>> do i=1,11
>> a(i) = 0.0
>> end do
>> end program memain
>> $ gfortran double.f90
>> double.f90:4:7:
>>
>> 3 | do i=1,11
>> | 2
>> 4 | a(i) = 0.0
>> | 1
>> Warning: Array reference at (1) out of bounds (11 > 10) in loop beginning at (2)
>>
>> (Well, it works for statically declared arrays, anyway).
> .
> This is easy enough to do at compile time, as the violation occurs
> in the same procedure as the declaration with explicit bounds.
> It becomes more difficult when the declaration is in another
> procedure. The diagnosis in such cases is then typically required at
> run time (and, in particular, when the bounds are dynamically generated).

This is why it might be useful to see why the original code, when
compiled with bounds checking, did not detect the array index overrun.
What quirky combination of situations and circumstances caused both the
compile time and the run time detection to fail? This information would
help the compiler writers to tighten up their diagnostics and also
normal programmers from falling into that trap in the future.

$.02 -Ron Shepard

Re: Segmentation Fault error

<45103d79-9817-4e2a-aec8-5edf025978e0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2921&group=comp.lang.fortran#2921

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1827:b0:35b:bb7f:6851 with SMTP id t39-20020a05622a182700b0035bbb7f6851mr15547393qtc.457.1663605496473;
Mon, 19 Sep 2022 09:38:16 -0700 (PDT)
X-Received: by 2002:ac8:5bd6:0:b0:35c:1a3b:14e0 with SMTP id
b22-20020ac85bd6000000b0035c1a3b14e0mr15808070qtb.487.1663605496332; Mon, 19
Sep 2022 09:38:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 19 Sep 2022 09:38:16 -0700 (PDT)
In-Reply-To: <wG_VK.220902$PRW4.17486@fx11.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:696f:b60a:dc48:b6eb;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:696f:b60a:dc48:b6eb
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <45103d79-9817-4e2a-aec8-5edf025978e0n@googlegroups.com>
Subject: Re: Segmentation Fault error
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 19 Sep 2022 16:38:16 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1945
 by: gah4 - Mon, 19 Sep 2022 16:38 UTC

On Monday, September 19, 2022 at 7:05:26 AM UTC-7, Ron Shepard wrote:

(snip)

> This is why it might be useful to see why the original code, when
> compiled with bounds checking, did not detect the array index overrun.
> What quirky combination of situations and circumstances caused both the
> compile time and the run time detection to fail? This information would
> help the compiler writers to tighten up their diagnostics and also
> normal programmers from falling into that trap in the future.

Yes.

There are some that are known to be harder to detect, though
not obvious enough for us to guess.

Re: Segmentation Fault error

<tgbiic$aqf1$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2922&group=comp.lang.fortran#2922

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Tue, 20 Sep 2022 05:20:12 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tgbiic$aqf1$1@newsreader4.netcologne.de>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
<wG_VK.220902$PRW4.17486@fx11.iad>
Injection-Date: Tue, 20 Sep 2022 05:20:12 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:1257:0:7285:c2ff:fe6c:992d";
logging-data="354785"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 20 Sep 2022 05:20 UTC

Ron Shepard <nospam@nowhere.org> schrieb:
> On 9/19/22 1:49 AM, Robin Vowels wrote:
>> On Monday, September 19, 2022 at 4:07:20 PM UTC+10, Thomas Koenig wrote:
>>> Lynn McGuire <lynnmc...@gmail.com> schrieb:
>>>> On 9/17/2022 3:51 AM, Pramod Yadava wrote:
>>>>> Respected sir,
>>>>> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
>>>>>
>>>>>
>>>>> Regards
>>>>> Pramod
>>>>> IESD BHU
>>>>
>>>> You need to run the code through a debugger and see where the segfault
>>>> is being generated.
>>>>
>>>> One of the most common issues is overrunning a local array:
>>>>
>>>> double precision x (10)
>>>> ...
>>>> x (11) = 11.0
>>>>
>>>> That will get you almost any time.
>>> $ cat double.f90
>>> program memain
>>> real, dimension(10) :: a
>>> do i=1,11
>>> a(i) = 0.0
>>> end do
>>> end program memain
>>> $ gfortran double.f90
>>> double.f90:4:7:
>>>
>>> 3 | do i=1,11
>>> | 2
>>> 4 | a(i) = 0.0
>>> | 1
>>> Warning: Array reference at (1) out of bounds (11 > 10) in loop beginning at (2)
>>>
>>> (Well, it works for statically declared arrays, anyway).
>> .
>> This is easy enough to do at compile time, as the violation occurs
>> in the same procedure as the declaration with explicit bounds.
>> It becomes more difficult when the declaration is in another
>> procedure. The diagnosis in such cases is then typically required at
>> run time (and, in particular, when the bounds are dynamically generated).
>
> This is why it might be useful to see why the original code, when
> compiled with bounds checking, did not detect the array index overrun.
> What quirky combination of situations and circumstances caused both the
> compile time and the run time detection to fail? This information would
> help the compiler writers to tighten up their diagnostics and also
> normal programmers from falling into that trap in the future.

There are several cases that come to mind that could easily
create such an error. A few examples:

real, dimension(10) :: a
call foo(a)
call bar(a)
call baz(a,11)
...

subroutine foo(a)
real, dimension(*) :: a
a(11) = 42.

SUBROUTINE BAR
REAL A(1) ! Old form of a(*), bounds checking off
A(11) = 42

subroutine baz(a,n)
integer :: n
real, dimension(n) :: a
a(n) = 42

Very difficult to detect, even at run-time. That is one reason
why assumed-shape arrays are so powerful.

Re: Segmentation Fault error

<NFdWK.461217$Ny99.276274@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2925&group=comp.lang.fortran#2925

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.2.2
Subject: Re: Segmentation Fault error
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
<wG_VK.220902$PRW4.17486@fx11.iad> <tgbiic$aqf1$1@newsreader4.netcologne.de>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <tgbiic$aqf1$1@newsreader4.netcologne.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 29
Message-ID: <NFdWK.461217$Ny99.276274@fx16.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Tue, 20 Sep 2022 02:08:29 -0500
X-Received-Bytes: 1785
 by: Ron Shepard - Tue, 20 Sep 2022 07:08 UTC

On 9/20/22 12:20 AM, Thomas Koenig wrote:
> There are several cases that come to mind that could easily
> create such an error. A few examples:
>
> real, dimension(10) :: a
> call foo(a)
> call bar(a)
> call baz(a,11)
> ...
>
> subroutine foo(a)
> real, dimension(*) :: a
> a(11) = 42.
>
> SUBROUTINE BAR
> REAL A(1) ! Old form of a(*), bounds checking off
> A(11) = 42
>
> subroutine baz(a,n)
> integer :: n
> real, dimension(n) :: a
> a(n) = 42

The OP said that the array was dimensioned 1:10, and he referenced
element 0 out of bounds. I would think that would normally be a case
that the compiler could catch.

$.02 -Ron Shepard

Re: Segmentation Fault error

<9ed8aee4-cd87-4dda-a358-7c74e4c395den@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2926&group=comp.lang.fortran#2926

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:5188:b0:4ad:25d7:12a with SMTP id kl8-20020a056214518800b004ad25d7012amr11892272qvb.0.1663664565894;
Tue, 20 Sep 2022 02:02:45 -0700 (PDT)
X-Received: by 2002:a05:6214:5185:b0:472:f9b0:cbc6 with SMTP id
kl5-20020a056214518500b00472f9b0cbc6mr18127513qvb.92.1663664565789; Tue, 20
Sep 2022 02:02:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 20 Sep 2022 02:02:45 -0700 (PDT)
In-Reply-To: <NFdWK.461217$Ny99.276274@fx16.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:79fc:ce3:596e:d97c;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:79fc:ce3:596e:d97c
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de> <NFdWK.461217$Ny99.276274@fx16.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9ed8aee4-cd87-4dda-a358-7c74e4c395den@googlegroups.com>
Subject: Re: Segmentation Fault error
From: gah4@u.washington.edu (gah4)
Injection-Date: Tue, 20 Sep 2022 09:02:45 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: gah4 - Tue, 20 Sep 2022 09:02 UTC

On Tuesday, September 20, 2022 at 12:08:33 AM UTC-7, Ron Shepard wrote:

(snip)

> The OP said that the array was dimensioned 1:10, and he referenced
> element 0 out of bounds. I would think that would normally be a case
> that the compiler could catch.

It does say that, but it doesn't say that the reference is in the same
subroutine.

First of all, with most systems you need to specify bounds check
on every compilation, if separate compilation is used.
And as noted above, some are more difficult to detect.

Though I have noted compilers that will detect the second (BAR)
case, even with (run-time) bounds check turned off.

Re: Segmentation Fault error

<d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2927&group=comp.lang.fortran#2927

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:2387:b0:496:c9db:82b0 with SMTP id fw7-20020a056214238700b00496c9db82b0mr18628579qvb.111.1663672499737;
Tue, 20 Sep 2022 04:14:59 -0700 (PDT)
X-Received: by 2002:ac8:5f47:0:b0:344:9fa7:18b5 with SMTP id
y7-20020ac85f47000000b003449fa718b5mr18763779qta.627.1663672499484; Tue, 20
Sep 2022 04:14:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 20 Sep 2022 04:14:59 -0700 (PDT)
In-Reply-To: <tgbiic$aqf1$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
Subject: Re: Segmentation Fault error
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Tue, 20 Sep 2022 11:14:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4498
 by: Robin Vowels - Tue, 20 Sep 2022 11:14 UTC

On Tuesday, September 20, 2022 at 3:20:15 PM UTC+10, Thomas Koenig wrote:
> Ron Shepard <nos...@nowhere.org> schrieb:
> > On 9/19/22 1:49 AM, Robin Vowels wrote:
> >> On Monday, September 19, 2022 at 4:07:20 PM UTC+10, Thomas Koenig wrote:
> >>> Lynn McGuire <lynnmc...@gmail.com> schrieb:
> >>>> On 9/17/2022 3:51 AM, Pramod Yadava wrote:
> >>>>> Respected sir,
> >>>>> i have run the wrf and getting error segmentation fault invalid memory reference but i have checked and we have sufficient memory. So kindly help me out here we can not pinpoint the exact problem.
> >>>>>
> >>>>>
> >>>>> Regards
> >>>>> Pramod
> >>>>> IESD BHU
> >>>>
> >>>> You need to run the code through a debugger and see where the segfault
> >>>> is being generated.
> >>>>
> >>>> One of the most common issues is overrunning a local array:
> >>>>
> >>>> double precision x (10)
> >>>> ...
> >>>> x (11) = 11.0
> >>>>
> >>>> That will get you almost any time.
> >>> $ cat double.f90
> >>> program memain
> >>> real, dimension(10) :: a
> >>> do i=1,11
> >>> a(i) = 0.0
> >>> end do
> >>> end program memain
> >>> $ gfortran double.f90
> >>> double.f90:4:7:
> >>>
> >>> 3 | do i=1,11
> >>> | 2
> >>> 4 | a(i) = 0.0
> >>> | 1
> >>> Warning: Array reference at (1) out of bounds (11 > 10) in loop beginning at (2)
> >>>
> >>> (Well, it works for statically declared arrays, anyway).
> >> .
> >> This is easy enough to do at compile time, as the violation occurs
> >> in the same procedure as the declaration with explicit bounds.
> >> It becomes more difficult when the declaration is in another
> >> procedure. The diagnosis in such cases is then typically required at
> >> run time (and, in particular, when the bounds are dynamically generated).
> >
> > This is why it might be useful to see why the original code, when
> > compiled with bounds checking, did not detect the array index overrun.
> > What quirky combination of situations and circumstances caused both the
> > compile time and the run time detection to fail? This information would
> > help the compiler writers to tighten up their diagnostics and also
> > normal programmers from falling into that trap in the future.
> There are several cases that come to mind that could easily
> create such an error. A few examples:
>
> real, dimension(10) :: a
> call foo(a)
> call bar(a)
> call baz(a,11)
> ...
>
> subroutine foo(a)
> real, dimension(*) :: a
> a(11) = 42.
>
> SUBROUTINE BAR
> REAL A(1) ! Old form of a(*), bounds checking off
> A(11) = 42
>
> subroutine baz(a,n)
> integer :: n
> real, dimension(n) :: a
> a(n) = 42
>
> Very difficult to detect, even at run-time. That is one reason
> why assumed-shape arrays are so powerful.
..
It is usually unnecessary to pass in the bound of an array.
It is important to create an interface block for each procedure
(a quick and effective way to do that is to use CONTAINS).
Old/obsolete forms of the language should not be intermixed
with modern safe forms.
Obsolete and error-prone forms of the language should not be used.

Re: Segmentation Fault error

<b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2928&group=comp.lang.fortran#2928

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:c9b:b0:6cb:cde2:27b5 with SMTP id q27-20020a05620a0c9b00b006cbcde227b5mr17783553qki.293.1663709180486;
Tue, 20 Sep 2022 14:26:20 -0700 (PDT)
X-Received: by 2002:a05:620a:10bc:b0:6ce:4169:7bcc with SMTP id
h28-20020a05620a10bc00b006ce41697bccmr18349479qkk.732.1663709180329; Tue, 20
Sep 2022 14:26:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 20 Sep 2022 14:26:20 -0700 (PDT)
In-Reply-To: <d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:801d:6cb1:b3ba:9341;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:801d:6cb1:b3ba:9341
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de> <d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>
Subject: Re: Segmentation Fault error
From: gah4@u.washington.edu (gah4)
Injection-Date: Tue, 20 Sep 2022 21:26:20 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2193
 by: gah4 - Tue, 20 Sep 2022 21:26 UTC

(snip)

> Obsolete and error-prone forms of the language should not be used.

Some of us run old obsolete programs, and don't feel like rewriting them.

Last year, I had IBM's ECAP running. It seems to trace to Fortran II days,
though was later partly updated to Fortran IV, but with many older
constructs still there.

Among others, it has a feature that I have never seen anywhere else.
It seems that you can:

CALL LINK(program)

and it will load another program replacing the current one, but keeping
the variables in COMMON. And, interestingly, it is not a string constant.

To make that work, I write all the COMMON blocks out to a disk file,
and read them back in later. Funny features that used to be there.

Re: Segmentation Fault error

<slrntikeft.ia6.gschroed@ansel.localnet>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2929&group=comp.lang.fortran#2929

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: gschroed@killSpam.pacific.edu (George Schroeder)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Tue, 20 Sep 2022 22:54:04 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <slrntikeft.ia6.gschroed@ansel.localnet>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
<wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de>
<d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
<b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>
Reply-To: gschroeder@killSpam.pacific.edu
Injection-Date: Tue, 20 Sep 2022 22:54:04 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="cb8d023738c1dda3a2796802dd271379";
logging-data="1711280"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rd4CdCOin/r9JlAFwx4JF"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:RV7Vw6DP8Az7v8Cp92kRBMO0SIc=
 by: George Schroeder - Tue, 20 Sep 2022 22:54 UTC

On Tue, 20 Sep 2022 14:26:20 -0700 (PDT), gah4 <gah4@u.washington.edu> wrote:
: : (snip)
: :> Obsolete and error-prone forms of the language should not be used.
: : Some of us run old obsolete programs, and don't feel like rewriting them.
: : Last year, I had IBM's ECAP running. It seems to trace to Fortran II days,
: though was later partly updated to Fortran IV, but with many older
: constructs still there.
: : Among others, it has a feature that I have never seen anywhere else.
: It seems that you can:
: : CALL LINK(program)
: : and it will load another program replacing the current one, but keeping
: the variables in COMMON. And, interestingly, it is not a string constant.
: : To make that work, I write all the COMMON blocks out to a disk file,
: and read them back in later. Funny features that used to be there.
: Boy, does that bring back memories! I learned programming (Fortran II) on
an IBM 1620 back in the early 60's. Later, I had to get ECAP running on
a 1620 model 2 which used FORTRAN IID.

You have the use of CALL LINK correct. It allowed programs which needed
more core than was available to be broken up into smaller pieces which
this statement could link together.

Re: Segmentation Fault error

<ac71553f-bd8f-4631-91ca-23a14a9b900bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2930&group=comp.lang.fortran#2930

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5dea:0:b0:4ac:6ffc:74b2 with SMTP id jn10-20020ad45dea000000b004ac6ffc74b2mr21496229qvb.78.1663738864982;
Tue, 20 Sep 2022 22:41:04 -0700 (PDT)
X-Received: by 2002:ac8:4e8b:0:b0:35d:9cb:ecfd with SMTP id
11-20020ac84e8b000000b0035d09cbecfdmr777128qtp.647.1663738864775; Tue, 20 Sep
2022 22:41:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 20 Sep 2022 22:41:04 -0700 (PDT)
In-Reply-To: <b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=202.67.103.232; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 202.67.103.232
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de> <d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
<b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ac71553f-bd8f-4631-91ca-23a14a9b900bn@googlegroups.com>
Subject: Re: Segmentation Fault error
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Wed, 21 Sep 2022 05:41:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1984
 by: Robin Vowels - Wed, 21 Sep 2022 05:41 UTC

On Wednesday, September 21, 2022 at 7:26:22 AM UTC+10, gah4 wrote:
> (snip)
> > Obsolete and error-prone forms of the language should not be used.
..
> Some of us run old obsolete programs, and don't feel like rewriting them.
..
I was referring to the example given (which you omitted).
No-one suggested anything like rewriting old programs.
..
> Last year, I had IBM's ECAP running. It seems to trace to Fortran II days,
> though was later partly updated to Fortran IV, but with many older
> constructs still there.

Re: Segmentation Fault error

<tgf0u3$d0j2$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2931&group=comp.lang.fortran#2931

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Segmentation Fault error
Date: Wed, 21 Sep 2022 12:43:47 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tgf0u3$d0j2$1@newsreader4.netcologne.de>
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com>
<wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de>
<d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
<b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com>
Injection-Date: Wed, 21 Sep 2022 12:43:47 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-1257-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:1257:0:7285:c2ff:fe6c:992d";
logging-data="426594"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 21 Sep 2022 12:43 UTC

gah4 <gah4@u.washington.edu> schrieb:
>
> (snip)
>
>> Obsolete and error-prone forms of the language should not be used.
>
> Some of us run old obsolete programs, and don't feel like rewriting them.
>
> Last year, I had IBM's ECAP running. It seems to trace to Fortran II days,
> though was later partly updated to Fortran IV, but with many older
> constructs still there.
>
> Among others, it has a feature that I have never seen anywhere else.
> It seems that you can:
>
> CALL LINK(program)
>
> and it will load another program replacing the current one, but keeping
> the variables in COMMON. And, interestingly, it is not a string constant.
>
> To make that work, I write all the COMMON blocks out to a disk file,
> and read them back in later. Funny features that used to be there.

The old systems had overlays, yes. I read the documentation at
the time I was working on mainframe systems, but I never needed
to use them.

What you can do today is the following: If you have two overlaid
programs which share COMMON data, just make the two PROGRAMs into
SUBROUTINEs and call them in turn.

There might be a problem with subroutines having the same name
in both programs, with different meanings. In that case, put
them into separate modules and make everything private except
for the called main program.

So, turn

PROGRAM P1
COMMON /COM/ ...
END PROGRAM P1

PROGRAM P2
COMMON /COM/ ...
END PROGRAM P2

into (keeping to fixed source here :-)

MODULE MY_COM
! Declare variables
COMMON /COM /...
END MODULE MY_COM

MODULE MY_P1
USE MY_COM
PRIVATE
PUBLIC :: P1
CONTAINS
SUBROUTINE P1
...
END SUBROUTINE P1
END MODULE MY_P1

MODULE MY_P2
USE MY_COM
PRIVATE
PUBLIC :: P2
CONTAINS
SUBROUTINE P2
...
END SUBROUTINE P2
END MODULE MY_P2

PROGRAMME MAIN
USE MY_P1, MY_P2
CALL P1
CALL P2

....

Re: Segmentation Fault error

<de0db190-5c93-4b5d-a756-47f270c7f1f5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2932&group=comp.lang.fortran#2932

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:424c:b0:6be:78d5:ec73 with SMTP id w12-20020a05620a424c00b006be78d5ec73mr21176138qko.579.1663792274905;
Wed, 21 Sep 2022 13:31:14 -0700 (PDT)
X-Received: by 2002:a05:6214:27e4:b0:4ac:a631:f551 with SMTP id
jt4-20020a05621427e400b004aca631f551mr24881981qvb.12.1663792274797; Wed, 21
Sep 2022 13:31:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 21 Sep 2022 13:31:14 -0700 (PDT)
In-Reply-To: <tgf0u3$d0j2$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:65bb:71a2:de44:3ab4;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:65bb:71a2:de44:3ab4
References: <8de339a6-ee6b-496e-932e-215a9c579adcn@googlegroups.com>
<tg635l$1hi$1@gioia.aioe.org> <tg90ul$93c0$2@newsreader4.netcologne.de>
<b6231e2b-d0b2-4a71-a47e-c314511d80b3n@googlegroups.com> <wG_VK.220902$PRW4.17486@fx11.iad>
<tgbiic$aqf1$1@newsreader4.netcologne.de> <d0d1f5be-d6bb-424e-9abc-e51025148d3bn@googlegroups.com>
<b0c538d3-3e8d-4672-bf87-577372155727n@googlegroups.com> <tgf0u3$d0j2$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de0db190-5c93-4b5d-a756-47f270c7f1f5n@googlegroups.com>
Subject: Re: Segmentation Fault error
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 21 Sep 2022 20:31:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3730
 by: gah4 - Wed, 21 Sep 2022 20:31 UTC

On Wednesday, September 21, 2022 at 5:43:50 AM UTC-7, Thomas Koenig wrote:
> gah4 <ga...@u.washington.edu> schrieb:

(snip)

> > Last year, I had IBM's ECAP running. It seems to trace to Fortran II days,
> > though was later partly updated to Fortran IV, but with many older
> > constructs still there.
> > Among others, it has a feature that I have never seen anywhere else.
> > It seems that you can:
> > CALL LINK(program)
> > and it will load another program replacing the current one, but keeping
> > the variables in COMMON. And, interestingly, it is not a string constant.
> > To make that work, I write all the COMMON blocks out to a disk file,
> > and read them back in later. Funny features that used to be there.

> The old systems had overlays, yes. I read the documentation at
> the time I was working on mainframe systems, but I never needed
> to use them.
> What you can do today is the following: If you have two overlaid
> programs which share COMMON data, just make the two PROGRAMs into
> SUBROUTINEs and call them in turn.

There is also an ECAP for the PDP-10, which does that.
It also uses many DEC specific features that are not in any standard.

The way it actually works, is that there is a main program that reads
in all the input data cards, one of which tells it to do DC, AC, or
transient analysis. It then LINKs to the appropriate program,
for that analysis. When done, that one LINKs back to main.

It does get more interesting, though. You can do a follow-on,
without entering the whole thing again. Maybe change one
parameter, and then try again.

In any case, yes, I could make them into subroutines, and then
when one returns, it goes to the right place.

In some cases, it might be more complicated. Instead of return,
it might link to different routines, that link to other different routines.
In that case, it would be necessary to pass back an indication of
where to go next.

It seems that this is before the overlays as I have always known them,
which work on subroutine calls, and overlay only part of the program.
I have known those overlays on many different systems.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor