Closed sweemer closed 1 month ago
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
You can try passing -fsanitize=address
to the linker manually.
<ItemGroup>
<LinkerArg Include="-fsanitize=address" />
</ItemGroup>
Thanks @hez2010 but it's not enough to link with ASan - the sources must be compiled with ASan as well, which must be implemented in the Native AOT compiler as far as I understand.
You have to build the native AOT runtime from source. There's no way to do that currently besides actually cloning this repo and following the instructions. The repo has native support for ASAN so all that should be needed is an extra flag: #74623.
@MichalStrehovsky Thanks for the explanation
Description
I have come across the
EnableNativeSanitizers
property, but adding it to my Native AOT app's csproj file doesn't seem to actually result in the app being compiled with AddressSanitizer. Is that expected?If this feature is not yet available, then can I hereby request it? It will be very useful for testing Native AOT apps, especially those that make use of direct P/Invoke and static linking to native libs that have also been built with AddressSanitizer.
Reproduction Steps
Expected behavior
Adding
EnableNativeSanitizers
andPublishAot
to a csproj file results in the app being built with AddressSanitizer.Actual behavior
The app is not built with AddressSanitizer.
Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response