- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Version: Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.2.1 Build 20240711
I have just verified this: ifx did not pass the "man or boy" test:
https://rosettacode.org/wiki/Man_or_boy_test#Fortran
Compiling and running the Fortran code contained in the URL above with ifx gives the error:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
libc.so.6 00007FD6A076BD00 Unknown Unknown Unknown
Unknown 00007FFDC2BD2480 Unknown Unknown Unknown
Compiling with ifort or gfortran runs successfully and gives the correct answer (-67).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This may be a stack size issue.
Can you investigate this (e.g k=8)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Changing the value of k in the main program, I verified that ifx runs and generates the same answer as with ifort and gfortran up to k = 3. For k >= 4 I get the error message.
If it is a stack size problem, is there a compilation option to change? I have the latest OneAPI installed in linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My Linux system is not up so I cannot test.
There is a compiler option Wl,option1[,option2,...] (lower case L)
That passes options onto the linker.
Try adding: , -Wl, --stack,<sizeYouWantHere>
Check the linker documentation for proper syntax and for how you represent the size argument.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The man or boy test program runs fine when compiled with ifx 2024.2.1 on Linux. The program prints the answer -67.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then this is strange. Did you use the standard options for compilation?
My system is:
Fedora Linux 40
~>ifx -V
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.2.1 Build 20240711
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
The OneAPI suite was installed via yum/rpm using Intel repo.
Compiling and running:
>ifx test_man_or_boy.f90
>./a.out
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
libc.so.6 00007FF26F64FD00 Unknown Unknown Unknown
Unknown 00007FFDAF38E300 Unknown Unknown Unknown
I get the same error in two different boxes with identical configurations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I am on Ubuntu 22.04, but compiled without any optional compiler options, exactly as you did above. My stack size is 8192 kbytes, according to the ulimit -s command (referred to by TobiasK below).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The stack size on my systems is the same (8192 k) and it's the same for gfortran and ifort. Compounding that with the meaning of the error message (see below), I don't think this is the issue.
Anyway, the nesting depth of the program does not seem to me large enough to provoke a stack overflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at the "List of Runtime Error Messages" in Intel's documentation, I've found:
severe (174): SIGSEGV, segmentation fault occurred
This message indicates that the program attempted an invalid memory reference. Check the program for possible errors.
So it seems that this is not related to stack size overflow, because in this case the error message would be:
severe (174): SIGSEGV, possible program stack overflow occurred
The following explanatory text also appears:
Program requirements exceed current stacksize resource limit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check your stack size limit:
ulimit -s
and probably increase it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran uses stack for temporaries. Other compilers use heap. We have the option
-heap-arrays
to allocated temporaries in heap instead of stack. Try that. that ulimit -s is another good option, but maybe hard to remember. Perhaps put that in your .bashrc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also keep in mind that ulimit -s does not set the stack size to "unlimited" - rather it uses a maximum value established when the kernel was built.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page