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

Internal Compiler Error in ifort 2019+

Bart_O_
Novice
1,809 Views
Hi, the below code causes a crash with ifort/ifx 2019+ including ifort (IFORT) 2021.1.2 20201208 and ifx (IFORT) 2021.1.2 Beta 20201214 $ cat bug.f90 module exception_callback public :: f_err_set_callback contains subroutine f_err_set_callback(callback) external :: callback end subroutine f_err_set_callback end module exception_callback module set_callback use exception_callback private public :: f_err_set_callback end module set_callback module main interface subroutine init() use set_callback end subroutine init end interface end module main end $ ifort bug.f90 bug.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error. compilation aborted for bug.f90 (code 1) $ ifx bug.f90 #0 0x00000000019a20c2 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a20c2) #1 0x00000000019a21f0 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a21f0) #2 0x00002b6f2df00400 __restore_rt (/lib64/libc.so.6+0x36400) #3 0x000000000177e7cb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x177e7cb) #4 0x00000000017565bf __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17565bf) #5 0x00000000018c0dbc __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c0dbc) #6 0x000000000174a9a8 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x174a9a8) #7 0x0000000001749c39 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1749c39) #8 0x000000000179bafb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179bafb) #9 0x00000000017a3337 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17a3337) #10 0x000000000179c0b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179c0b4) #11 0x0000000001796250 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1796250) #12 0x00000000017ca5c4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17ca5c4) #13 0x00000000017cb8b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17cb8b4) #14 0x000000000198de28 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x198de28) #15 0x00000000018c5d7c __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c5d7c) #16 0x0000000001a28f18 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1a28f18) #17 0x00002b6f2deec555 __libc_start_main (/lib64/libc.so.6+0x22555) #18 0x00000000016e8182 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x16e8182) bug.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error. compilation aborted for bug.f90 (code 1) The file was trimmed down from an actual crash compiling BigDFT 1.8.3.
0 Kudos
7 Replies
Bart_O_
Novice
1,803 Views

Sorry, the formatting was messed up above. Here is the file again:

 

module exception_callback
  public :: f_err_set_callback
contains
  subroutine f_err_set_callback(callback)
    external :: callback
  end subroutine f_err_set_callback
end module exception_callback

module set_callback
   use exception_callback
   private
   public :: f_err_set_callback
end module set_callback

module main
  interface
     subroutine init()
       use set_callback
     end subroutine init
  end interface
end module main

end
0 Kudos
Bart_O_
Novice
1,801 Views
$ ifort --version
ifort (IFORT) 2021.1.2 20201208
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

$ ifx --version
ifx (IFORT) 2021.1.2 Beta 20201214
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

$ ifort bug.f90
bug.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for bug.f90 (code 1)

$ ifx bug.f90
 #0 0x00000000019a20c2 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a20c2)
 #1 0x00000000019a21f0 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x19a21f0)
 #2 0x00002b6f2df00400 __restore_rt (/lib64/libc.so.6+0x36400)
 #3 0x000000000177e7cb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x177e7cb)
 #4 0x00000000017565bf __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17565bf)
 #5 0x00000000018c0dbc __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c0dbc)
 #6 0x000000000174a9a8 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x174a9a8)
 #7 0x0000000001749c39 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1749c39)
 #8 0x000000000179bafb __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179bafb)
 #9 0x00000000017a3337 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17a3337)
#10 0x000000000179c0b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x179c0b4)
#11 0x0000000001796250 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1796250)
#12 0x00000000017ca5c4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17ca5c4)
#13 0x00000000017cb8b4 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x17cb8b4)
#14 0x000000000198de28 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x198de28)
#15 0x00000000018c5d7c __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x18c5d7c)
#16 0x0000000001a28f18 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x1a28f18)
#17 0x00002b6f2deec555 __libc_start_main (/lib64/libc.so.6+0x22555)
#18 0x00000000016e8182 __tls_get_addr (/tmp/oldeman/easybuild_intel/oneapi/compiler/2021.1.2/linux/bin/xfortcom+0x16e8182)

bug.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for bug.f90 (code 1)
0 Kudos
Arjen_Markus
Honored Contributor I
1,792 Views

You probably already know that but ICEs (internal compiler errors) are always serious errors, independent of whether your code is correct or not.

0 Kudos
Bart_O_
Novice
1,722 Views

Note that there are at least two ways to workaround the issue:

1.

use the import statement and move the use to module scope like this:

module main
  use set_callback
  interface
     subroutine init()
       import set_callback
     end subroutine init
  end interface
end module main

or using the original module directly instead of the one that wraps it:

module main
  interface
     subroutine init()
       use exception_callback
     end subroutine init
  end interface
end module main

the second method worked well for BigDFT (viz. https://github.com/ComputeCanada/easybuild-easyconfigs/blob/computecanada-master/easybuild/easyconfigs/b/BigDFT/ifort_no_ice.patch  )

Ron_Green
Moderator
1,712 Views

I'll open a bug report.  thanks for bringing this to our attention

0 Kudos
Ron_Green
Moderator
1,705 Views

bug ID CMPLRLLVM-25770


0 Kudos
Ron_Green
Moderator
1,414 Views

sorry for the late update - In reviewing older issues I found this report. This bug was fixed in oneapi 2021.4 last year. And I tested the latest ifort and ifx to confirm it's no longer causing Internal Compiler Error.


ron


0 Kudos
Reply