Topic: Debugger - Segmentation fault - SIGSEGV

My program compiles with the default settings without messages, but on Launching immediately returns the message:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  fffffffff

I see from the GNU Insight Forum that this fault is ongoing and several people have tried to patch it.

What I need to know is which FORTRAN feature sets off this trap. I can perhaps program around it, if I know what causes the problem. The program stops on a USE instruction, before the first executable statement.

Re: Debugger - Segmentation fault - SIGSEGV

John,

What architecture are you currently compiling for, 32- or 64-bit?  This option is configurable in the Project Options window.  You might try switching this option, if possible, depending on your operating system, and retry debugging.

Let us know if you have any luck.

Jeff Armstrong
Approximatrix, LLC

Re: Debugger - Segmentation fault - SIGSEGV

I loaded up vers. 1.39 yesterday and the compile default had become:

C:\Programfiler\Simply Fortran\mingw-w64\bin\gfortran.exe

I browsed my way to this program:

C:\Programfiler\Simply Fortran\mingw-w64\x86_64-w64-mingw32\bin\gfortran.exe

and set it as the compiler.

The result was the following error message on the first of three files to be compiled:

"C:\Programfiler\Simply Fortran\mingw-w64\x86_64-w64-mingw32\bin\gfortran.exe" -c -o "build\shmod.o" -g -m32 -I"C:/Programfiler/Simply Fortran/mingw-w64/x86_64-w64-mingw32/include/"  -Jmodules "shmod.f90"
gfortran.exe: error: CreateProcess: No such file or directory
Error(E42): Last command making (build\shmod.o) returned a bad status
Error(E02): Make execution terminated

My computer is a 32bit model (Dell)
I gather the download doesn't interogate the system or use the existing settings

Re: Debugger - Segmentation fault - SIGSEGV

John,

The original path should be the correct one.  Did C:\Programfiler\Simply Fortran\mingw-w64\bin\gfortran.exe not exist?  I understand that the path you changed it to exists, but the desired program is the first path.

The error you're seeing is most likely due to the compiler not finding the proper subprograms it executes.

Was there any reason you decided to edit the compiler location?  Did you encounter an issue before you changed the location?

Jeff Armstrong
Approximatrix, LLC

Re: Debugger - Segmentation fault - SIGSEGV

I tried the gFortran.exe that I found by browsing under Options - Compiler...  just to see if that was the one I should be using. Obviously this was wrong, so I went back to the original one, without success. The reason for trying this change was that the file path suggests that the file I am using now is for 64-bit computers, while I am running on a 32-bit one.

The choice under Project options is correctly set and has been all the time.

Re: Debugger - Segmentation fault - SIGSEGV

John,

There is only one compiler, the one originally set in the compiler options, and it can produce both 32- and 64-bit targets.  There should be no reason to change this.

Does your program by any chance employ large, statically-allocated arrays?  Do you receive the error message when you run the program outside the debugger as well?

The error seems to imply that your program hasn't even effectively started running when the segmentation fault occurs.  I'm just wondering if some static allocations are exceeding the ~1.5GB limit 32-bit Windows imposes on processes.

Jeff Armstrong
Approximatrix, LLC

Re: Debugger - Segmentation fault - SIGSEGV

The program requires nowhere near a Gb. There are less than  40 single-precision, real arrays of (2,50) and 3 of (20,20) that are  statically allocated in individual subroutines plus about 50 other common variables in a single module.
The message didn't come until I started running 1.39 last Thursday evening. Before that I had been on the version I downloaded originally Nov 21 (1.34 or 1.35) and the error didn't occur. I was still debugging the numerical procedures in the program when I saw the new version was available.

Re: Debugger - Segmentation fault - SIGSEGV

John,

The debugger was "upgraded" in version 1.39, and the new version did fix a number of issues people had reported.  You might try uninstalling 1.39 and installing 1.38 instead (all versions are available on the Download page), which still uses Insight 7.4.50.  The bug may be in Insight itself.  I'll try to figure out what the issue is on my end.

Jeff Armstrong
Approximatrix, LLC

Re: Debugger - Segmentation fault - SIGSEGV

I have borrowed a 64-bit laptop and loaded down v.1.40. After changing the project setting it compiles w/o error, but on launching immediately gives the same error message as previously, but now with 16 characters in the back-tracking address: #0 fffffffffffffff.

Re: Debugger - Segmentation fault - SIGSEGV

John,

I'm not sure I can answer the question without being able to replicate the issue on my end.  Would you be willing to send either the full code causing the issue or a slimmed-down version that still exhibits the behavior?

Additionally, I still encourage you to try debugging under 1.38.  That version ships with a slightly older version of Insight, which might not have this issue.  The versions of Insight in Simply Fortran 1.39 and 1.40 are identical.

Jeff Armstrong
Approximatrix, LLC