- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I use the check uninit option in a large, mixed language (fortran and C) project with the new ifx driver I get a huge amount of the following linking errors:
undefined reference to `__msan_chain_origin'
with references to numerous other routines from the memory sanitizer all beginning with __msan. If I turn the uninit check off, the project compiles and links successfully.
I am using ifx version 2023.2.0. I am using CMake, which automatically selects ifx to link the executable.
Should I be passing further options to the linker, so that it finds the memory sanitzer routines?
- Tags:
- ifx
- memory sanitizer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you compile with -check uninit (or -check all) you also need to link with that compiler option.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you compile with -check uninit (or -check all) you also need to link with that compiler option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are my options for a mixed language (fortran and c++) application where some fortran code is compiled (ifx) with "-check uninit" but the application is linked with icpx (which does not recognize the -check option )? I'm on Linux using OneAPI-2024.2.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use "-fsanitize=memory" when compiling C/C++ to be used with "-check uninit" from ifx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your C++ code is the main of the program, then remember to insert early into your main(...)
int argc;
char **argv;
void for_rtl_init_ (int *, char **);
for_rtl_init_ (&argc, argv);And at the end of the program
int io_status;
int for_rtl_finish_ ( );
io_status = for_rtl_finish_ ( );It is probably best practice in C++ to make a class or struct with the ctor doing the init and the dtor doing the finish.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mark,
I will try that and report results back here.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code is a mix of C/C++ and fortran. The C/C++ is compiled with icc/icpx while the fortran is compiled with ifort. All compilers are from the intel-2024.2.1 suite. The fortran compiles include "-g -O0 -traceback -init=arrays,snan -check bounds,uninit -fpe0". The C/C++ flags may include -fsanitize=memory. The link is attempted with ifort and that gives the error about missing msan_*. An attempt to link with ifx results in a different error. An attempt to link with "icpc -fsanitize=memory ...." results in "undefined reference to symbol 'for_array_initialize'"
That's where things stand.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page