-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: -fsanitize=address doesn't work with exceptions #3760
Comments
Please paste the full ASan output here. |
Hi Johan, Sure, here it is (It is identical on all runs) Kind regards,
AddressSanitizer can not provide additional info. |
Hi again Johan, I apologise, it isnt the same on each run. Here is another ASAN report: .\test.exe==9532==ERROR: AddressSanitizer: unknown-crash on address 0x0279dcbe5e88 at pc 0x7ff6fdf6b4d9 bp 0x00d05432e640 sp 0x00d05432e680
Address 0x0279dcbe5e88 is located in the low shadow area. |
I'm quite sure this is a problem with ASan on Windows and exceptions. Can you simplify the testcase so that it does not use a class, or phobos stdio. I think simply throwing an exception and catching it will trigger the problem. |
Hi Johan, I can confirm that class example: Exception {
this(string msg, string file = __FILE__, size_t line = __LINE__) {
super(msg, file, line);
}
}
void main() {
try {
throw new example("test");
} catch (example e) {
auto a = (e.msg == "test");
}
} also causes the issue. But access to e.msg is required. Is there any fix or workaround available? Kind regards, |
I don't know the workaround, but when googling a bit, it looks like it is a known issue and some people report that with changing settings in VS it does work... |
The testcase obviously works just fine without ASan, just for clarification. |
Hi Martin,
I'm not 100% sure. I was using throw in the constructor to return an
instance of something with a different type. To work around constructors
only returning the specific type.
I think I was having issues storing the returned thrown object, hence why I
started fuzzing and then asan testing.
I've given up on that, and avoiding exceptions now. I now have a factory
function that returns a variant.
So.. I'm not sure
Kind regards
Mike
…On Sat, 19 Jun 2021, 19:09 Martin Kinkelin, ***@***.***> wrote:
I am having issues with throwing exceptions in constructors.
The testcase obviously works just fine without ASan, just for
clarification.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3760 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOAIW2SEANM2F4LWWH2JODTTTMMRANCNFSM46SODWCQ>
.
|
Wow, sounds extremely weird! :D - A factory returning a variant seems much more reasonable. If you think the original code should really have worked (edit: or reported a better error), please file that as a separate issue with according code. |
Hi all,
On Windows 10 64bit, LDC2 1.27.0-beta1. I am having issues with throwing exceptions in constructors. Address sanatiser is able to catch the issue as an access violation. Here is example code to trigger this issue:
Compiled with:
ldc2.exe -g -fsanitize='address' .\test.d -of='test.exe'
Access Violation is on "writeln(e.msg)" line.
Kind regards,
Mike Brown
The text was updated successfully, but these errors were encountered: