You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a new target for AddressSanitizer as extra credit #275
One of the things we do in the C track is have a separate compilation target for validating memory accesses, which we do using AddressSanitizer. We should implement a similar check here by adding a new target into each exercise's CMakeLists to run the tests under ASan, and document that to describe it as extra credit for the students in the 'Running the Tests' doc page.
Possibly add a build with MemorySanitizer as well to track uninitialized reads, but ASan is generally more useful.
Not all valid? Haven't stumbled across that yet but am super curious to learn what your concerns are. I've been bitten by false positives before; there actually seem to be (?) bugs in older versions of gcc's TSan implementation.
Would you prefer a separate make target or a CMake option? In other contexts I've used options with success, something like -DENABLE_ASAN and -DENABLE_UBSAN. I don't have a strong opinion in this use case. CMake recompiles appropriately if you change an option.
Options might be better if we allow for multiple sanitizers. For example, ASan and UBsan can be enabled independently and/or simultaneously.
By 'not valid', I should have said "I don't know much about UBSan, but based on what it does I'd guess it may generate false positives".
Honestly I'm not sure if a separate make target or a CMake option is better, either would work. I'd probably prefer CMake, at least with how ASan works, since it's a configuration option that you'd want to just apply to all the builds your doing.
Yea, I think adding these behind a CMake option sounds good. I'm not too
concerned about providing that build option, especially since we don't plan
to make it mandatory anywhere.
On Mon, May 6, 2019 at 8:33 AM Kevin W Matthews ***@***.***> wrote:
I see. If UBSan is a configurable option, maybe it isn't so bad to try it?
It could be confusing, but one wouldn't be forced into it.
I think the CMake option is the way to go if possible - it matches
everything else in the track.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#275 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABHHBQPOWWUOVCNUSCHZTLPUBFULANCNFSM4HHKD3RQ>
.
Activity
KevinWMatthews commentedon Apr 20, 2019
Awesome; good idea.
Might be worth adding the undefined behavior sanitizer, too.
arcuru commentedon Apr 20, 2019
True, though I'm not entirely sure if all of the UBSan checks are valid. Worth looking into though :)
KevinWMatthews commentedon Apr 21, 2019
Not all valid? Haven't stumbled across that yet but am super curious to learn what your concerns are. I've been bitten by false positives before; there actually seem to be (?) bugs in older versions of gcc's TSan implementation.
Would you prefer a separate make target or a CMake option? In other contexts I've used options with success, something like
-DENABLE_ASANand-DENABLE_UBSAN. I don't have a strong opinion in this use case. CMake recompiles appropriately if you change an option.Options might be better if we allow for multiple sanitizers. For example, ASan and UBsan can be enabled independently and/or simultaneously.
KevinWMatthews commentedon Apr 26, 2019
Started this but want to run a few more tests before opening a PR.
arcuru commentedon Apr 27, 2019
By 'not valid', I should have said "I don't know much about UBSan, but based on what it does I'd guess it may generate false positives".
Honestly I'm not sure if a separate make target or a CMake option is better, either would work. I'd probably prefer CMake, at least with how ASan works, since it's a configuration option that you'd want to just apply to all the builds your doing.
In the C track we just have a separate make target, but everything is done through the makefile - https://github.com/exercism/c/blob/master/exercises/hello-world/makefile
KevinWMatthews commentedon May 6, 2019
I see. If UBSan is a configurable option, maybe it isn't so bad to try it? It could be confusing, but one wouldn't be forced into it.
I think the CMake option is the way to go if possible - it matches everything else in the track.
arcuru commentedon May 8, 2019
KevinWMatthews commentedon Jun 18, 2019
@KevinWMatthews note to self...