- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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 kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
This may be a stack size issue.
Can you investigate this (e.g k=8)
Jim Dempsey
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The man or boy test program runs fine when compiled with ifx 2024.2.1 on Linux. The program prints the answer -67.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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).
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Please check your stack size limit:
ulimit -s
and probably increase it.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite