- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am creating a program in Fortran90.
"Forrtl: severe (174): SIGSEGV, segmentation fault occurred" occurs in an array in a structure.
I tried to check the index by writing a print statement to identify the cause, but the error disappeared when I wrote the print statement for some reason. Also, when I added -check bounds, the error disappeared as well.
The compiler used intel Fortran, and an error occurred at that time, but when using gfortran, no error occurred.
If you know the cause, can you tell me?
Thank you.
Best
Christoph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you first compile your code with all the warnings and runtime checks enabled. You may have argument mismatch and/or index out of range. I see you used -check bounds. This will catch many of the indexing errors, but not all. The interface checking will also catch additional bounds errors. For example when a dummy argument is declared as REAL FOO(10) and called with actual argument of size other than 10..
If that doesn't lead to a resolution then, are you linking with 3rd party libraries (including your own) which may not have a properly declared interfaces? For example, calling a C compiled function without declaring the interface is to use C calling convention/
AT90's reference is to declaring (explicitly or implicitly) a loop/function/subroutine as to being vector aligned when in fact it is not.
Please state the version number of the compiler.
Jim Dempsey
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you by any chance enabling vectorization?
One possible answer is that you have told the compiler to vectorize the loop, and that causes a seg fault due to fault memory access.
When you enable print statements the loop won't vector any longer and hence the seg fault does not occur.
But the best would be to show the code to specifically say what is wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Somehow I wrote similar things here:
https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/812227
as you posted this twice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest you first compile your code with all the warnings and runtime checks enabled. You may have argument mismatch and/or index out of range. I see you used -check bounds. This will catch many of the indexing errors, but not all. The interface checking will also catch additional bounds errors. For example when a dummy argument is declared as REAL FOO(10) and called with actual argument of size other than 10..
If that doesn't lead to a resolution then, are you linking with 3rd party libraries (including your own) which may not have a properly declared interfaces? For example, calling a C compiled function without declaring the interface is to use C calling convention/
AT90's reference is to declaring (explicitly or implicitly) a loop/function/subroutine as to being vector aligned when in fact it is not.
Please state the version number of the compiler.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much everyone! That fixed my issue.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page