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

ifx misbehaves with /heap-arrays0, PACK intrinsic, polymorphic arguments and Mondays

IanH
Honored Contributor III
870 Views

I had a dickens of a time tracking this one down. 

ifx 2024.2.0 is doing something silly copying function results under certain circumstances, including the use of /heap-arrays0, a polymorphic argument (not used) and the PACK intrinsic.

 

>ifx /debug:full /Od /heap-arrays0 /standard-semantics /stand:f03 /warn:all /traceback /check:all /libs:static /threads /dbglibs LetsDoLunch.f90 && LetsDoLunch.exe
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.2.0 Build 20240602
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

LetsDoLunch.f90(16): warning #7762: This procedure is recursive by default.   [EXECUTE_LUNCH]
  SUBROUTINE execute_lunch(something_to_eat, book_to_read)
-------------^
LetsDoLunch.f90(27): warning #7762: This procedure is recursive by default.   [DOWNLOAD_BOOK]
  SUBROUTINE download_book
-------------^
LetsDoLunch.f90(16): remark #7712: This variable has not been used.   [SOMETHING_TO_EAT]
  SUBROUTINE execute_lunch(something_to_eat, book_to_read)
---------------------------^
Microsoft (R) Incremental Linker Version 14.40.33813.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:LetsDoLunch.exe
-nodefaultlib:libcpmt
-debug
-pdb:LetsDoLunch.pdb
-subsystem:console
-incremental:no
LetsDoLunch.obj
 15
forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source
LetsDoLunch.exe    00007FF6FFF6B162  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFF6C1BF  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFF6B310  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFF6B463  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFF61CEC  EXECUTE_LUNCH              24  LetsDoLunch.f90
LetsDoLunch.exe    00007FF6FFF610EF  LETSDOLUNCH                14  LetsDoLunch.f90
LetsDoLunch.exe    00007FF6FFF7120B  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFFCE639  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFFCE552  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFFCE40E  Unknown               Unknown  Unknown
LetsDoLunch.exe    00007FF6FFFCE6AE  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FF980107374  Unknown               Unknown  Unknown
ntdll.dll          00007FF98193CC91  Unknown               Unknown  Unknown

 

0 Kudos
4 Replies
Ron_Green
Moderator
801 Views

Interesting one.  I do not see the runtime abort on linux.  Something in the PACK call in the FRTL and it's calls to the Windows C runtime is sure to be the problem.  The linux PACK is behaving itself.  I'll have to dig further into this.  thanks for the great reproducer!

 

ron

0 Kudos
Ron_Green
Moderator
780 Views

I will get a bug report opened on this.  I am pretty sure it's NOT the FRTL based on my tests.  It's in the Front End and definitely related to the heap-arrays changing the references passed to PACK.

0 Kudos
Jacob_Williams
New Contributor II
587 Views

I have maybe a similar crash with pack() and derived types and ifx 2024.2 on Windows. Was about to make a new topic when I saw this one. I'll upload my example here if I can make a simpler reproducer.

Ron_Green
Moderator
460 Views

I forgot to add the bug ID here: CMPLRLLVM-61566


Reply