Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

ifx 2024.0 bug still there with 2024.2

JFH
New Contributor I
1,097 Views

This program compiles with ifx 2024.2 -check-all -standard-semantics but the memory sanitizer crashes it at run time.

```

! Free source form program initial9.f90 by J F Harper
implicit none
integer,parameter:: k1 = kind(1e0), k2 = kind(1d0), &
k3 = selected_real_kind(30)
real(k1) :: ni1(2), h1 = huge(ni1) ! ni is short for naninf
real(k2) :: ni2(2), h2 = huge(ni2)
real(k3) :: ni3(2), h3 = huge(ni3)
character(24) :: cni = 'NAN INF NAN INF NAN INF '
print "(A,3(1X,I0))",'Real kinds printed before nan_inf called:',k1,k2,k3
call testnaninf
contains
subroutine testnaninf
logical :: nanOK(3,2)
read(cni,*) ni1, ni2, ni3
nanOK(:,1) = [ ni1(1)/=ni1(1),ni2(1)/=ni2(1),ni3(1)/=ni3(1) ]
nanOK(:,2) = [ ni1(2) > h1 ,ni2(2) > h2 ,ni3(2) > h3 ]
write(*,"(A,3L2)") ' NaN/=NaN? ',nanOK(:,1),' Inf>huge? ',nanOK(:,2)
end subroutine testnaninf
end program

```

This is what happened when compiling and running  it in an x86_64 Ubuntu system:

```

(lf) john:~/Test$ /opt/intel/oneapi/compiler/2024.2/bin/ifx -check all -standard-semantics initial9.f90
(lf) john:~/Test$ ./a.out
Real kinds printed before nan_inf called: 4 8 16
==8352==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5f8f74 in __gtq (/home/john/Test/a.out+0x5f8f74) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)
#1 0x40caaa in __for_ieee_signaling_gt_k16_ (/home/john/Test/a.out+0x40caaa) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)
#2 0x49c8ab in _unnamed_main$$_IP_testnaninf_ (/home/john/Test/a.out+0x49c8ab) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)
#3 0x49bac3 in MAIN__ (/home/john/Test/a.out+0x49bac3) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)
#4 0x40e338 in main (/home/john/Test/a.out+0x40e338) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)
#5 0x7f08d8c29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#6 0x7f08d8c29e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#7 0x40e204 in _start (/home/john/Test/a.out+0x40e204) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)

Uninitialized value was created by an allocation of 'mech_info' in the stack frame
#0 0x4da9d1 in for_write_seq_fmt_xmit (/home/john/Test/a.out+0x4da9d1) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/john/Test/a.out+0x5f8f74) (BuildId: 0c947e101bf23f02e341ec9b23a746ff84eb1896) in __gtq
Exiting
(lf) john:~/Test

```

 

0 Kudos
1 Solution
Devorah_H_Intel
Moderator
991 Views

@JFH Didn't you report this already here?

Compiler bugs take a few months to fix, sooner if you have Priority support. 

View solution in original post

0 Kudos
2 Replies
Devorah_H_Intel
Moderator
1,009 Views

Thank you for reporting this. I reproduced it internally, and this issue has now been escalated to our Compiler engineering for a fix.  

0 Kudos
Devorah_H_Intel
Moderator
992 Views

@JFH Didn't you report this already here?

Compiler bugs take a few months to fix, sooner if you have Priority support. 

0 Kudos
Reply