Sanitizer crash on Windows when using exceptions

Hi,

We are using intel icx from oneapi 2024.2 or 2025. On Linux everything works perfectly (we used sanitizer for all code and tests even java tests with jni)
Unfortunately on Windows we have problems when using exceptions.

Please consider the following reproducer
//////////////////////////////////////////////////////////////////////////////////////
//icx -Od -EHsc -Z7 test.cxx
//works with output “Caught error no. 5 exception at test.cxx in line 15”

//icx -Od -fsanitize=address -EHsc -Z7 test.cxx
//crashes with “Caught error no. Segmentation fault”
#include
struct Error {
int a;
};
void info(const char* f, const int l, const Error& e) {
std::cout << "Caught error no. " << e.a << " exception at " << f << " in line " << l << std::endl;
}
int main() {
try {
throw Error{5};
} catch (Error &e) {
info(FILE, LINE, e);
return 0;
}
return 1;
}

It chrashes with
Caught error no. =================================================================
==111536==ERROR: AddressSanitizer: access-violation on unknown address 0xffffffffffffffff (pc 0x7ff7a3a4104c bp 0x006ce24ff880 sp 0x006ce24fceb0 T0)
==111536==The signal is caused by a READ memory access.
#0 0x7ff7a3a4104b (D:\tmp\sanitizer_rep\test.exe+0x14000104b)
#1 0x7ff7a3a412b4 (D:\tmp\sanitizer_rep\test.exe+0x1400012b4)
#2 0x6ce24ff65f ()

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: access-violation (D:\tmp\sanitizer_rep\test.exe+0x14000104b)
==111536==ABORTING

Please also have a look at

They answered me in personal that they won’t fix it, because it is a bug in the original clang inplementation…

It would be very nice if this bug will be fixed (if possible). The sanitizer is such a valuable tool, we would like to use it also on Windows.

Best regards
Frank

1 Like

Does no one else encountered this problem on Windows?