Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28855 Discussions

Segfault with procedure argument when -g supplied

zjibben
Beginner
625 Views

I've run into a bug with the latest version of ifx (2024.0.2 on Arch Linux). I'm getting a segfault with the following simple program:

 

program main

  implicit none

  abstract interface
    subroutine proc_t()
    end subroutine proc_t
  end interface

  integer :: i

  i = 1
  call run(a)

contains

  subroutine a()
    print *, i
  end subroutine a

  subroutine run(proc)
    procedure(proc_t) :: proc
    call proc
  end subroutine run

end program main

 

The segfault occurs only when I compile with -g:

 

$ ifx main.F90 && ./a.out
           1
$ ifx -g main.F90 && ./a.out
ifx: remark #10440: Note that use of a debug option without any optimization-level option will turnoff most compiler optimizations similar to use of '-O0'
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
libc.so.6          00001316EBF25770  Unknown               Unknown  Unknown
Unknown            00007FFD21434938  Unknown               Unknown  Unknown

 

Labels (3)
0 Kudos
3 Replies
Barbara_P_Intel
Employee
598 Views

Nice reproducer. Unfortunately, I cannot duplicate the segfault on Fedora 38 or Ubuntu 22.04.3. 

Arch Linux is not supported by Intel.

What version of GCC is installed?  gcc --version

 

0 Kudos
zjibben
Beginner
596 Views

Oh interesting, maybe it's my system then. My gcc reports 13.2.1 20230801.

 

I just tried on a cluster with ifx 2023.1.0, running what seems like SUSE enterprise linux 15 with gcc 7.5.0. No error.

 

I'll see if I can get my hands on anything else.

0 Kudos
zjibben
Beginner
540 Views

Alright, I managed to get my hands on a couple more systems.

 

Fedora 39, up to date with glibc 2.38, does not reproduce this error.

 

However Fedora Rawhide, up to date with glibc 2.39 (same as my Arch system), does reproduce the error. I also discovered that it's sufficient to only specify -O0 (-g isn't needed).

0 Kudos
Reply