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

ifx 2024.0.0 throws and error in simple write statement when "-check all" is used

Marcos_V_1
New Contributor I
1,065 Views

Check this simple code in Linux using ifx 2024.0.0. When using the "-check all" flag in the build script:

#!/bin/bash
rm -f *.o
#fails
ifx -m64 -check all -O0 -g -o test main.f90
#works
#ifx -m64 -O0 -g -o test main.f90

 

Running the any of the write statements in main.f90, i.e:

print*, ' Fire Dynamics Simulator'

Leads to the following error:

$./test

Uninitialized bytes in write at offset 0 inside [0x725000000000, 1)
==6267==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x4a9997 in for__write_output (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4a9997) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#1 0x4aa711 in for__put_sf (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4aa711) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#2 0x4914bb in for_write_seq_fmt_xmit (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4914bb) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#3 0x490589 in for_write_seq_fmt (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x490589) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#4 0x489e9b in MAIN__ /media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/main.f90:6:1
#5 0x40a588 in main (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x40a588) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#6 0x7f5b55629d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#7 0x7f5b55629e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#8 0x40a454 in _start (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x40a454) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)

Uninitialized value was created by a heap allocation
#0 0x417e66 in malloc (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x417e66) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#1 0x48e3c2 in for__get_vm (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x48e3c2) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#2 0x4b57d8 in for__open_proc (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4b57d8) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#3 0x4a7e79 in for__open_default (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4a7e79) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#4 0x48fe57 in for_write_seq_fmt (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x48fe57) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#5 0x489e9b in MAIN__ /media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/main.f90:6:1
#6 0x40a588 in main (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x40a588) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24)
#7 0x7f5b55629d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/media/psf/Home/Documents/FIREMODELS_FORK/Intel_ifx_exec/test+0x4a9997) (BuildId: 240a0846b6ba7363e2dd990790632b7351090a24) in for__write_output
Exiting

 

We don't see this issue with ifort classic.

I wonder if anyone has come through this issue already?

Thank you

Marcos

0 Kudos
1 Solution
Marcos_V_1
New Contributor I
1,047 Views
Thank you Barbara!
We'll keep this in mind and wait for the ifx fix.
Marcos

View solution in original post

0 Kudos
3 Replies
Barbara_P_Intel
Employee
1,057 Views

-check all includes -check uninit. It's the -check uninit that causes the traceback. Unfortunately, right now it's a bogus traceback. A remedy is in the works. Prior to ifx 2024.0, -check uninit was a no op.

A workaround is to use -check all,nouninit.

-check uninit enables the LLVM Memory Sanitizer (MSan). 

With ifx, scalars, arrays, array slices, array elements, allocatable, automatics, and derived types are examined. By contrast, IFORT could only catch local scalar variables of intrinsic type INTEGER, REAL, COMPLEX, and LOGICAL without the SAVE attribute.

 

Marcos_V_1
New Contributor I
1,048 Views
Thank you Barbara!
We'll keep this in mind and wait for the ifx fix.
Marcos
0 Kudos
Barbara_P_Intel
Employee
1,004 Views

I forgot to mention this Forum post from Ron Green. It has other workarounds for the -check uninit problem.

AND on Windows "/check:uninit" is a no op. LLVM doesn't support MSan (memory sanitizer) on Windows, so Intel doesn't either at this time. I filed a feature request because it IS a popular feature!

0 Kudos
Reply