<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — SIGSEGV - segmentation fault, only when debugging]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=385&amp;type=atom" />
	<updated>2015-02-10T12:51:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=385</id>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1894#p1894" />
			<content type="html"><![CDATA[<p>You are a grafter, Jeff, that&#039;s for sure!<br />I&#039;ll look forward to receiving it.</p><p>If you really have succeeded (and I do not hold you to it), then I&#039;m sure that everyone in your forum will be extremely interested in what exactly this problem has been, how you diagnosed it and how on earth you managed to cure it.<br />---<br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2015-02-10T12:51:45Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1894#p1894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1893#p1893" />
			<content type="html"><![CDATA[<p>John,</p><p>I think I&#039;ve got the debugger-only crashing fixed in regards to the file dialog. I&#039;ll send you an email sometime today with the new WFDialogs library to try out.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2015-02-10T12:37:24Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1893#p1893</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1850#p1850" />
			<content type="html"><![CDATA[<p>John,</p><p>I&#039;ve sent you an email with a possibly fixed version of the <a href="http://packages.simplyfortran.com/package/72.html">Windows Fortran Dialogs</a>&nbsp; package that might eliminate the debugger-only crash circumstance.&nbsp; I&#039;m hopeful it works.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2015-01-28T15:01:15Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1850#p1850</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1625#p1625" />
			<content type="html"><![CDATA[<p>That&#039;s very encouraging.&nbsp; So nice to know I&#039;m not the only one!<br />I hope you manage to solve yet another problem that no-one else has managed to fix.<br />It&#039;s a real nuisance not to be able to use the debugger! <br />-- <br />J.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-25T00:24:14Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1625#p1625</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1624#p1624" />
			<content type="html"><![CDATA[<p>John,</p><p>Some searching on the Internet shows that there are quite a few people experience crashes when calling <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646927%28v=vs.85%29.aspx">GetOpenFileName</a> or <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646928%28v=vs.85%29.aspx">GetSaveFileName</a> (the functions that actually opens a file dialog in Windows) in programs being debugged in the GNU Debugger (Simply Fortran&#039;s underlying debugging engine).&nbsp; I&#039;ll see what solutions I can find.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-24T18:09:44Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1624#p1624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1623#p1623" />
			<content type="html"><![CDATA[<p>Alas I have no ideas I can suggest, although a possible clue might be that Helmut Michels was apparently able to run a test program using his debugger, without this causing a crash.<br />--- <br />J.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-24T15:41:36Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1623#p1623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1622#p1622" />
			<content type="html"><![CDATA[<p>John,</p><p>It sounds like the core of the issue is that using standard Windows file dialogs in conjunction with Simply Fortran&#039;s debugger causes a crash in the program being debugged.&nbsp; I was able to replicate the crash on my system originally, so I&#039;ll try to investigate more.&nbsp; I don&#039;t have an immediate guess as to what&#039;s occurring, though.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-24T14:27:01Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1622#p1622</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1621#p1621" />
			<content type="html"><![CDATA[<p>It crashes to a SIGSEGV fault when trying to execute the statement at label 10 in the code fragment below:</p><div class="codebox"><pre><code>      SUBROUTINE GetFileName(ChangePath)
C     ----------------------------------
C     jw / 25-07-12  1st draft started
C     jw / 15-02-14  last rev.

C     On returning from this subroutine:

C The INPUT file pathname should be stored in
C TRIM(F%Path)//TRIM(F%Name)//&#039;.&#039;//TRIM(F%I%Ext).

C     F%I%Exists should indicate whether 
C     the INPUT file already exists.
C     F%I%OPEN should indicate whether 
C     it is already open.

C     F%bakExists should indicate whether
C     a BAK file already exists.
C     (It should not be open).

C     F%O%Exists should indicate whether 
C    the OUTPUT file already exists.
C     F%O%OPEN should indicate whether 
C     it is already open.

      USE Dislin
      USE Files
      USE wfdialogs
      LOGICAL EXISTS, ChangePath

C     IF(F%Named) RETURN

C     Input filename not yet known
      F%Path = (&#039;      &#039;)
      F%Name = (&#039; &#039;)
      F%I%Exists = .FALSE.
      F%I%OPEN = .FALSE.
      F%BAKexists = .FALSE.
      F%BAKdeletable = .FALSE.

      CALL SWGOPT(&#039;STANDARD&#039;,&#039;DIALOG&#039;) !Use STANDARD file dialog boxes
C     Prompt user for a data input Path\filename.ext
      F%Path = &#039; &#039;

10    IF(RequestOpenFile(F%Path,
     +&#039;Default DATA file type&#039;,&#039;*.ins&#039;,
     + &#039;Enter or select a structure DATA filename&#039;)) THEN
          CALL SWGOPT(&#039;TOP&#039;,&#039;DIALOG&#039;)!Keep all other dialog boxes on top

          CALL ParsePath(F%PATH,F%Name,F%I%Ext)
          IF(LEN_TRIM(F%I%Ext).EQ.0) F%I%Ext=&#039;ins&#039;
          F%O%Ext = &#039;rtf&#039;
          F%Named = .TRUE.

C         Set the current directory to that of the chosen file
          IF(ChangePath) CALL CHDIR(F%Path,iDone)
          :
          :
          : {more}
          :
          :
          :</code></pre></div><p>The crash happens mid-way through the process of drawing and populating the filename requester dialog box.&nbsp; At first, it managed only to draw the box outline and insert the title-bar caption, &#039;Enter or select a structure DATA filename&#039;, but the box was empty.&nbsp; When I commented out the next line, viz,<br /></p><div class="codebox"><pre><code>          CALL SWGOPT(&#039;TOP&#039;,&#039;DIALOG&#039;)!Keep all other dialog boxes on top</code></pre></div><p>this enabled the dialog box to start to fill, with about 30% of its normal content being written into it before the crash.</p><p>The crash does not happen when running outside the debugger.</p><p>If you have time to look into this any further and would like the latest version of my project code, please let me know and I&#039;ll send it.<br />--- <br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-24T13:19:24Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1621#p1621</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1615#p1615" />
			<content type="html"><![CDATA[<p>John,</p><p>At what point does the program crash now?&nbsp; Is it when the file dialog is opened?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-22T00:09:19Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1615#p1615</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1614#p1614" />
			<content type="html"><![CDATA[<p>SitRep:</p><p>I am still getting this SIGSEGV fault on a project whenever I use the debugger, on a program which compiles, links, loads and runs without error when not debugging.&nbsp; This is after switching away from DISLIN for filename requester dialogs and using Jeff&#039;s very neat routines instead.</p><p>If anyone else has the same experience, it might be helpful to hear about it.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-21T11:06:33Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1614#p1614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1600#p1600" />
			<content type="html"><![CDATA[<p>Thanks Jeff.&nbsp; <br />Works perfectly.</p><p>I see the Package Manager mentions that is 32/64.&nbsp; I should have noticed that.<br />This is an extremely helpful development for SF.<br />I do hope you can continue to add to this library.&nbsp; <br />I think you should also mention it in SF &quot;news&quot;.<br />--- <br />J.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-07T19:03:25Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1600#p1600</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1599#p1599" />
			<content type="html"><![CDATA[<p>John,</p><p>I&#039;ve added the file dialog title argument like you suggested.&nbsp; Also, it now allows requesting text entry or selection from a list via simple calls.&nbsp; The latest version is available in the <a href="http://packages.simplyfortran.com/package/72.html">Package Manager</a>.</p><p>It already supports 64-bit projects.&nbsp; Just switch your project to 64-bit and compile.&nbsp; It should work fine.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-07T16:38:45Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1599#p1599</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1598#p1598" />
			<content type="html"><![CDATA[<p>I Like this new library very much, Jeff.<br />Might you be adding to it gradually?</p><p>I&#039;d appreciate also a 64bit version.</p><p>I like the way that, as well as accepting a filename extension filter, the the filename requester dialog also accepts a string for naming or describing the default file type.</p><p>Small suggestion:<br />The filename requester dialog box could benefit from a text string parameter that can be passed to it, to display in the top bar.&nbsp; I was using this in the DISLIN version to display a prompt.<br />---<br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2014-11-07T11:22:35Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1598#p1598</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1597#p1597" />
			<content type="html"><![CDATA[<p>John,</p><p>If you&#039;re interested in trying, I&#039;ve built a small library that provides a file open and save dialog from Fortran that doesn&#039;t seem to crash.&nbsp; It is not an exact replica of DISLIN&#039;s functions, but it is similar enough:</p><p><a href="http://packages.simplyfortran.com/package/72.html">http://packages.simplyfortran.com/package/72.html</a></p><p>There is no example project included, but the documentation can be viewed at:</p><p><a href="https://bitbucket.org/ArmstrongJ/wfdialogs/overview">https://bitbucket.org/ArmstrongJ/wfdialogs/overview</a></p><p>and an example program can be seen at:</p><p><a href="https://bitbucket.org/ArmstrongJ/wfdialogs/src/5b916bf422be83dc59ccbf7d82e9c77a17cad2d7/driver.f90?at=master">https://bitbucket.org/ArmstrongJ/wfdial … ?at=master</a></p><p>When linking, you&#039;ll need to remember to add the flags:</p><div class="codebox"><pre><code>-lwfdialogs -lcomdlg32</code></pre></div><p>Hopefully you can just use these calls rather than the problematic DISLIN call.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-06T22:04:10Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1597#p1597</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SIGSEGV - segmentation fault, only when debugging]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=1596#p1596" />
			<content type="html"><![CDATA[<p>If we were using different compilers, then we were doubtless using different linkers, which are part of the &quot;binutils&quot; package.&nbsp; I&#039;m not sure what version we&#039;re shipping at the moment.&nbsp; However, I doubt that would cause the issue.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-11-06T20:43:56Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=1596#p1596</id>
		</entry>
</feed>
