rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
192 stars 54 forks source link

CI: Add windows runner with enabled address sanitizer. #2147

Closed ni4 closed 7 months ago

ni4 commented 8 months ago

Description

Since Visual Studio 2019 version 16.9 it supports address sanitizer, as described here: https://learn.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-170 Currently Github runners use 16.11, so it would be good to add Windows runs with address sanitizers enabled.

ni4 commented 8 months ago

@maxirmx Would you have time to look into it? I'm trying to build quick-n-dirty debug PoC here https://github.com/rnpgp/rnp/pull/2143, but that is not something which should go to the main.

maxirmx commented 8 months ago

@ni4, I will look at it.

ni4 commented 8 months ago

Thanks!

ni4 commented 8 months ago

@maxirmx Managed to build and run with sanitizers, you may find these lines useful:

if (ENABLE_SANITIZERS)
  add_compile_options(-fsanitize=address /Zi /MT)
  add_link_options(/DEBUG)
endif()
maxirmx commented 8 months ago

@ni4 thank you I want to do some extra things. As I wrote elsewhere right now python scripts can run in Unix environment only (== MSys on Windows) even we are doing native MSVC build Practically it means that it is not possible to use debugger and it is very har to run tests locally. I would like to fix it to support future bug fix