Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
601 Discussions

address sanitizer on Windows in debug build fails

Frank_R_1
Beginner
1,417 Views

Dear support,

 

When compiling with icx and address sanitizer on Windows in debug mode, we get the following error message during compilation:

error: cannot make section .ASAN$GL associative with sectionless symbol ?id@?$numpunct@D@std@@2V0locale@2@A

 

debug compile parameters are:

-fp=precise -Qimf-arch-consistency:true -Qfma- -MD -bigobj -EHsc -Qstd=c++17 -Od -Ob0 -Z7 -DDEVELOP -fsanitize=address -fsanitize-address-use-after-scope

 

with release this does not occur!

 

Setup:

Windows 10

Intel oneAPI 2023.1.0

 

Best regards

Frank

 

0 Kudos
10 Replies
Frank_R_1
Beginner
1,378 Views

Hi,

Consider the trivial program:
#include<cstdio>

int main() {
return 0;
}

Compile with:
icx -W -Wall -Wextra -Wpedantic -Wvla -Wunused-template -Wtautological-unsigned-zero-compare -Wtautological-unsigned-enum-zero-compare -Wshift-sign-overflow -Wmissing-variable-declarations -Wno-enum-constexpr-conversion -Wno-strict-prototypes -Wno-gnu-zero-variadic-macro-arguments -Wno-register -Wno-deprecated-register -Wno-pragma-pack -Wno-#pragma-messages -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-format-security -Wno-writable-strings -Wno-deprecated-declarations -DMS64 -D_CONSOLE -D_LIB -DNT -D_AMD64_ -DWIN64 -DWIN32 -DWINDOWS64 -D_MBCS -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX -nologo -fp=precise -Qimf-arch-consistency:true -Qfma- -MD -bigobj -EHsc -Qstd=c++17 -O3 -Ob2 -DNDEBUG -Oi -fsanitize=address -fsanitize-address-use-after-scope -Z7 -c test.cxx

Link with:
link -machine:x64 -WHOLEARCHIVE:clang_rt.asan_dynamic-x86_64.lib -WHOLEARCHIVE:clang_rt.asan_dynamic_runtime_thunk-x86_64.lib -WHOLEARCHIVE:vcasan.lib -nologo -STACK:10485760 -OPT:REF -INCREMENTAL:NO -FIXED:NO -MAP -DEBUG -DEBUGTYPE:CV -subsystem:console test.obj

Start with Visual Studio 2019 debugger and you will get what you see in the attached image.


It crashes at the beginning before even the main routine starts.
The crash is caused by clang_rt.asan_dynamic-x86_64.dll internally.

What do we wrong?
We would really like to use the icx sanitizer as a replacement to pointer check of icc/icl

Best regards
Frank

0 Kudos
Frank_R_1
Beginner
1,345 Views

Hi,

on Linux RHEL8 we run into the following problem:

==85532==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7f62def34f10 sp 0x7f62def346c8 T1)
==85532==Hint: pc points to the zero page.
==85532==The signal is caused by a READ memory access.
==85532==Hint: address points to the zero page.
#0 0x0 (<unknown module>)
#1 0x7f6160ad6a5a (/lib64/libnss_dns.so.2+0x1a5a) (BuildId: 84a643b847c3129604fbebcb3c70027cfb113dd5)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>)
Thread T1 created by T0 here:
#0 0x7f62e54d9e2e (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so+0x10ce2e)
#1 0x7f62e49f2d87 (/net/avdi0de055/data/p4ws/repo_cache/mature/jdk_adopt_hotspot/11.0.15_10/LINUX64_217/jre/bin/../lib/jli/libjli.so+0x9d87)
#2 0x7f62e49ef37c (/net/avdi0de055/data/p4ws/repo_cache/mature/jdk_adopt_hotspot/11.0.15_10/LINUX64_217/jre/bin/../lib/jli/libjli.so+0x637c)
#3 0x7f62e49f09ff (/net/avdi0de055/data/p4ws/repo_cache/mature/jdk_adopt_hotspot/11.0.15_10/LINUX64_217/jre/bin/../lib/jli/libjli.so+0x79ff)
#4 0x55ebddff8a72 (/net/avdi0de055/data/p4ws/repo_cache/mature/jdk_adopt_hotspot/11.0.15_10/LINUX64_217/jre/bin/java+0xa72)
#5 0x7f62e4459d84 (/lib64/libc.so.6+0x3ad84) (BuildId: f65c85bfdb904b623d4fe2139b4d7c25cf8c0b58)

==85532==ABORTING

 

The process starts a java vm which obviously uses /lib64/libnss_dns.so.2 and this causes problems.

Is there a workaround or fix of this behavior?

Best regards

Frank

0 Kudos
SeshaP_Intel
Moderator
1,342 Views

Hi,


Thank you for posting in Intel Communities.

We have used Visual Studio 2022 17.4.4 and the application did not crash with the provided reproducer.

Could you please try debugging using Visual Studio 2022 and let us know the results?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Frank_R_1
Beginner
1,296 Views

Hi,

 

Unfortunately we only have Visual Studio 2019 16.11.16 because this is our production environment. So it would be nice if you also use this version.

At startup a lot of 0xC0000005 Errors are shown! But when I disable these exceptions in the debugger it runs.

But without debugger no run possible!

 

Best regards

Frank

 

0 Kudos
SeshaP_Intel
Moderator
1,231 Views

Hi,

 

We were able to reproduce your issue in Visual Studio 2019 after enabling the exceptions. We have informed the development team about it.

We will get back to you soon.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
SeshaP_Intel
Moderator
1,113 Views

Hi,


This behavior is expected from Address Sanitizer on Windows. 

You can refer to this page: https://github.com/google/sanitizers/wiki/AddressSanitizerWindowsPort#debugging.


Address Sanitizer on Windows relies on these exceptions to work. This exception is not caused by the Intel oneAPI product but by the Address Sanitizer.


I hope this answers your query. Could you please confirm whether we can close this thread from our end?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Frank_R_1
Beginner
1,079 Views

Hi,

 

The problem is not using the debugger. I can switch of exceptions and the program ran till the end.

I just can not start the program without debugger, because it directly crashes!

On Linux we use this with no problem. I also set environment variables correct.

 

Best regards

Frank

0 Kudos
SeshaP_Intel
Moderator
1,002 Views

Hi,

 

>>> I just can not start the program without debugger, because it directly crashes!

 

On Windows, I have tried to compile and link the sample program with provided commands.

And I have imported the executable into Visual Studio 2019 and am able to see the output without any crashes using the start without Debugging(Ctrl+F5) option.

Could you please try to use Start Without Debugging option under Debug properties and let us know the results?

 

>>> On Linux we use this with no problem. I also set environment variables correctly.

 

On Linux, you have provided a crash report previously, was the issue resolved?

 

Am I missing something? I'm a bit confused by your replies. Could you please confirm whether we both are on the same page?

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
SeshaP_Intel
Moderator
954 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
860 Views

Hi,


I have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Reply