<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Newbee: how to cope with SIGSEGV]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=611</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=611&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Newbee: how to cope with SIGSEGV.]]></description>
		<lastBuildDate>Tue, 07 Mar 2017 17:13:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Newbee: how to cope with SIGSEGV]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2780#p2780</link>
			<description><![CDATA[<p>I downloaded and ran your code, and I do indeed receive the segmentation fault.&nbsp; If you run your code via our debugger, you&#039;ll see that the program fails on line 76:</p><div class="codebox"><pre><code>PAR=-1</code></pre></div><p>I&#039;m guessing the program crashes for a combination of reasons:</p><ol class="decimal"><li><p>You&#039;re calling the <em>AREA</em> subroutine without an interface</p></li><li><p>You&#039;re attempting to assign a value to a passed parameter</p></li></ol><p>I think the code fails because the calling program does not have any knowledge of the subroutine, and the subsequent write to the <em>PAR</em> variable is problematic.&nbsp; I&#039;m not sure why the code bothers to reassign an input value that seems to be a flag, but regardless...</p><p>If you comment out that code, it will fail later on line 17:</p><div class="codebox"><pre><code>      Write (*, 9991) INTEGRAL</code></pre></div><p>The format string expects a whole list of values to be passed, but your code is passing only a single value.&nbsp; It should work if you change it solely to:</p><div class="codebox"><pre><code>      Write (*, *) INTEGRAL</code></pre></div><p>With that change, though, the code still basically outputs zero as your integral.&nbsp; I suspect something is still wrong.</p><p><em>EDIT: Looking at the code, I guess it isn&#039;t wrong.&nbsp; It appears to be computing the area under a sine wave, which correctly sums to zero.</em></p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 07 Mar 2017 17:13:25 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2780#p2780</guid>
		</item>
		<item>
			<title><![CDATA[Newbee: how to cope with SIGSEGV]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=2779#p2779</link>
			<description><![CDATA[<p>I&#039;m new to this Fortan Environment - back to this language after years...<br />I&#039;m currently transferring a Fortran progam to JS (ExtendScript used by Adobe) and had a problem to get wrong results in my &#039;translated&#039; program. To find the error in my &#039;translation&#039; i installed SF:<br /></p><ul><li><p>I preceeded the subroutine I got from a physicist by a short test program</p></li><li><p>When compiling (Build &gt; Compile and Run) I get the message «Program received signal SIGSEGV: Segmentation fault - invalid memory reference.»</p></li><li><p>I tried hard (including research in this forum) but did not find a reason for this.</p></li><li><p>Abandoning the first subroutine (there is a second one called by the first) and integrating it into the test pgm worked.</p></li><li><p>So i could find why my JavaScript version did not create correct results.</p></li></ul><p>I want to use Simply Fortran for more projects (I have not yet purchased) and hence need to understand what&#039;s going on with this error.</p><p>The program is not long. You may have a look at <a href="http://daube.ch/zz_tests/QSimpson.for">http://daube.ch/zz_tests/QSimpson.for</a></p><p>Any ideas are welcome</p><p>PS: Don&#039;t flame the progammer! The programming style is awkward: I have not yet re-learned the syntax and rules of newer fortran versions (I&#039;m 75) - in particular not which version is used in SF - and my colleagues routine obviously is Fortran 66 style...</p>]]></description>
			<author><![CDATA[null@example.com (KLD)]]></author>
			<pubDate>Tue, 07 Mar 2017 14:09:32 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=2779#p2779</guid>
		</item>
	</channel>
</rss>
