raddebugger icon indicating copy to clipboard operation
raddebugger copied to clipboard

Crash when address sanitizer is enabled

Open nukoseer opened this issue 1 year ago • 2 comments

When I compile my program with /fsanitize=address option, it directly crashes when started in raddbg. raddbg directly jumps to address sanitizer source before it reaches to the main function and Main thread interrupted - 0xc0000005 message appears under the screen. I remember 0xc0000005 means access violation but it occurs before the main function somehow. I tested it with 2 diffent programs and both of them behaved same when /fsanitize=address is set. I also checked them without debugger and with the Visual Studio Debugger for reference and there was no problem in those cases.

nukoseer avatar Jan 12 '24 15:01 nukoseer

Thanks for reporting this. It looks like this has to do with ASan's strategy of using exception handlers to on-demand map pages. I'm going to look into the expected debugger strategy here. In the meantime, if you open up the Exception Filters view (image), you can disable the 0xc0000005 exception code. When testing, I hit a few more unexpected breakpoints (e.g. in malloc), so there is still some investigation & fixing I need to do, but this should at least get you into your program.

ryanfleury avatar Jan 12 '24 22:01 ryanfleury

Yes, it worked when I disabled access violation exception. Thank you!

nukoseer avatar Jan 12 '24 23:01 nukoseer

As of 42993b3fb0ff52d00f6deb964a3e48fd0328402b, the exceptions used by ASan to on-demand map pages in their "shadow address space" will be silently filtered by the debugger. Let me know if you run into any further issues with this.

ryanfleury avatar Jan 20 '24 02:01 ryanfleury