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

debugging the with the new ifx

lrego-developer
New Contributor I
2,097 Views

Hello,

I have worked with ifort based oneAPI for several years. 

In case of problem, for debugging the code I use the flags

safe: FC_ALL += -check all -traceback -fstack-protector -assume protect_parens -implicitnone -warn all,noexternal -fpe-all=0
safe: CC_ALL += -traceback -fstack-protector

 

and that gave a clear traceback of the error module-by-module, up to the line where the fault occurred.

After changing to the new ifx, I traceback that I can not understand, like this:

 

Using only CPU
Uninitialized bytes in strlen at offset 0 inside [0x703000000000, 45)
==30847==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x2d7ddd0 in for_getenv_err (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2d7ddd0) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#1 0x58468f in type_m_mp_get_environment_vars_ (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x58468f) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#2 0x2d60c5e in MAIN__ (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2d60c5e) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#3 0x40c908 in main (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x40c908) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#4 0x7fcef6846249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: 82ce4e6e4ef08fa58a3535f7437bd3e592db5ac0)
#5 0x7fcef6846304 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27304) (BuildId: 82ce4e6e4ef08fa58a3535f7437bd3e592db5ac0)
#6 0x40c7d0 in _start (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x40c7d0) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)

Uninitialized value was created by a heap allocation
#0 0x41a1e6 in malloc (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x41a1e6) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#1 0x2da2cb2 in for__get_vm (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2da2cb2) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#2 0x2d7dd4b in for_getenv_err (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2d7dd4b) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#3 0x58468f in type_m_mp_get_environment_vars_ (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x58468f) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#4 0x2d60c5e in MAIN__ (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2d60c5e) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#5 0x40c908 in main (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x40c908) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d)
#6 0x7fcef6846249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: 82ce4e6e4ef08fa58a3535f7437bd3e592db5ac0)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/lrego/QMMM/development/dynemol-dir/dynemol+0x2d7ddd0) (BuildId: 8ce95fb477415bcba6c8e832994b8d0f912d940d) in for_getenv_err
Exiting

 

How can I get the simpler and clearer debug of ifort with ifx?

Do I have to change the debug flags?

Thanks in advance.

 

0 Kudos
1 Solution
Barbara_P_Intel
Employee
2,065 Views

All that information is from -check uninit. It is part of -check all. 

With ifx the LLVM memory sanitizer is used and that's the info you get when an uninitialized variable is used. Add -g to get source file and line number.

To disable it change "-check all" to "-check all,nouninit". 

 

View solution in original post

6 Replies
Barbara_P_Intel
Employee
2,066 Views

All that information is from -check uninit. It is part of -check all. 

With ifx the LLVM memory sanitizer is used and that's the info you get when an uninitialized variable is used. Add -g to get source file and line number.

To disable it change "-check all" to "-check all,nouninit". 

 

lrego-developer
New Contributor I
2,038 Views
0 Kudos
Barbara_P_Intel
Employee
2,025 Views

Good! But you may want to check out that uninitialized variable.

ifx checks scalars, arrays, array slices, array elements, allocatable, automatics, and derived types.

By contrast, IFORT could only catch local scalar variables of intrinsic type INTEGER, REAL, COMPLEX, and LOGICAL without the SAVE attribute.

Compile and link

  • Add –g to get the symbols
  • Add –traceback for more details.
  • Compile and link the whole application for best accuracy

 

0 Kudos
Barbara_P_Intel
Employee
1,966 Views

FYI... for Windows users, "ifx /check:uninit" is a no op. A feature request was submitted. 

0 Kudos
lrego-developer
New Contributor I
1,936 Views

Dear Barbara_P_Intel

another issue with ifx when using debug/safe flags such as -g -check all,nouninit

I get a lot of error messages like 

ld: EDT.o: in function `ATOM_implicit_mapper':
ifxlUO9Z8.i:(.text+0x24cec): undefined reference to `__tgt_mapper_num_components'
ld: ifxlUO9Z8.i:(.text+0x24d30): undefined reference to `__tgt_push_mapper_component'
ld: ifxlUO9Z8.i:(.text+0x24d66): undefined reference to `__tgt_mapper_num_components'
ld: ifxlUO9Z8.i:(.text+0x24d9e): undefined reference to `__tgt_push_mapper_component'
ld: ifxlUO9Z8.i:(.text+0x24eab): undefined reference to `__tgt_push_mapper_component'
ld: ifxlUO9Z8.i:(.text+0x24fbc): undefined reference to `__tgt_push_mapper_component'
ld: ifxlUO9Z8.i:(.text+0x250cd): undefined reference to `__tgt_push_mapper_component'
ld: ifxlUO9Z8.i:(.text+0x251de): undefined reference to `__tgt_push_mapper_component'
ld: EDT.o:ifxlUO9Z8.i:(.text+0x252ef): more undefined references to `__tgt_push_mapper_component' follow

I just checked this is not an issue with ifort, which compiles with complaints.

0 Kudos
Barbara_P_Intel
Employee
1,915 Views

Can you share a reproducer? 

0 Kudos
Reply