'use-of-uninitialized-value' warning with '-check all' option of 'ifx'

Why does the check all option of ifx show a use-of-uninitialized-value warning for print and write commands?

program test
   implicit none
   print*, "Hello World!"
end program test
ifx test.f90 -g -traceback -O0 -check all
ifx (IFX) 2023.2.0 20230622
Uninitialized bytes in __interceptor_write at offset 0 inside [0x725000000000, 14)
==715395==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4a8847 in for__write_output (/pvt/prj/test/a.out+0x4a8847) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #1 0x4a95be in for__put_sf (/pvt/prj/test/a.out+0x4a95be) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #2 0x4936d1 in for_write_seq_lis_xmit (/pvt/prj/test/a.out+0x4936d1) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #3 0x48f8f2 in for_write_seq_lis (/pvt/prj/test/a.out+0x48f8f2) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #4 0x488ba4 in MAIN__ /pvt/prj/test/test.f90:3:4
    #5 0x40a578 in main (/pvt/prj/test/a.out+0x40a578) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #6 0x7f0cde648d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0x7f0cde648e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #8 0x40a444 in _start (/pvt/prj/test/a.out+0x40a444) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)

  Uninitialized value was created by a heap allocation
    #0 0x416d36 in __interceptor_malloc /netbatch/donb00013_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/llvm/compiler-rt/lib/msan/msan_interceptors.cpp:933:3
    #1 0x48d472 in for__get_vm (/pvt/prj/test/a.out+0x48d472) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #2 0x4b8349 in for__open_proc (/pvt/prj/test/a.out+0x4b8349) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #3 0x4a6d4a in for__open_default (/pvt/prj/test/a.out+0x4a6d4a) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #4 0x48f3a3 in for_write_seq_lis (/pvt/prj/test/a.out+0x48f3a3) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #5 0x488ba4 in MAIN__ /pvt/prj/test/test.f90:3:4
    #6 0x40a578 in main (/pvt/prj/test/a.out+0x40a578) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b)
    #7 0x7f0cde648d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/pvt/prj/test/a.out+0x4a8847) (BuildId: 651c59f3a6ec2721360a931dfb6fe92bf178ca5b) in for__write_output
Exiting
1 Like

The output you show looks like a report from valgrind. These could very well be messages coming from system or runtime libraries, not so much from the program itself.

Intel LLVM compiler, ifx, provides a new feature called memory sanitizer. It was explained in the event shared by @shahmoradi:

At that time, it seemed to have some problems or at least inconvenient to use because of its output.
Unless it is intentionally planned to use the new feature, it is better to disable ā€œuninitā€, otherwise it is enabled by ā€œ-check allā€. In the video, it was explained how to disable it.

2 Likes

Yes, indeed. It seems that ifx makes use of Valgrind.

Using -check nouninit can now be considered.

I hope that this issue will be resolved in the near future because itā€™s causing problems when using fpm with a debug profile. Perhaps it would be better to include this flag for ifx in the debug profile of fpm at this moment.

2 Likes

Itā€™s the LLVM Sanitizers being used by IFX. There is a bug with this initial release in the msan libs. Weā€™ll fix that in 2024.1 Update release. For now, yes, simply replace
-check all
or
-check uninit
with
-check all,nouninit
or
-check nouninit

OR you can unset the env var LIBRARY_PATH or remove the path in this variable to /2024.0.0/compiler/2024.0/lib

1 Like

Thanks @greenrongreen. looking forward to the 2024.1 Update release.