Skip to content
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

Remove duplicate ASAN linker option. #4624

Closed
wants to merge 3 commits into from
Closed

Remove duplicate ASAN linker option. #4624

wants to merge 3 commits into from

Conversation

teo-tsirpanis
Copy link
Member

@teo-tsirpanis teo-tsirpanis commented Jan 12, 2024

This PR removes a linker option that is already globally specified here:

add_link_options("$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=${TILEDB_SANITIZER}>")


TYPE: BUILD
DESC: Remove duplicate ASAN linker option.

@@ -826,7 +826,7 @@ Status Array::reopen(uint64_t timestamp_start, uint64_t timestamp_end) {
array_uri_,
key->encryption_type(),
key->key().data(),
key->key().size(),
static_cast<uint32_t>(key->key().size()),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in #4601.

Copy link
Contributor

@eric-hughes-tiledb eric-hughes-tiledb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description is wholly inadequate. A couple of links are supporting references, not a description. What work was actually done? It doesn't look like anything was.

There's no indication that it even addresses the concerns from the PR, which is that the unit tests need to be built with ASAN. That means, and this time I need to be explicit, that we have some way of verifying that the unit tests are being built with ASAN. We have had problems in the past deluding ourselves that something was being tested that was not. As a specific instruction, ensure the following is done:

  • Write two test related tests executables that compiles the same way that the unit tests do.
    • One will be compiled both with and without ASAN
    • The other will compiled only with ASAN
  • These executables will terminate early when compiled with ASAN
    • This is a death test, which Catch does not support, so in order not to fail CI there will need to be some kind of runner or wrapper around the executable.
  • The executable that can be compiled without ASAN should succeed.
  • Both executables use memory region poisoning.
    • The executable that compiles both with and without ASAN uses the macro ASAN_POISON_MEMORY_REGION, which has a feature test that omits the call when sanitization is absent.
    • The executable that compiles only with ASAN uses the function __asan_poison_memory_region. This should fail to compile without ASAN; it would be good to test this failure in CMake, but that's optional.
  • These executables should both run in CI alongside the unit tests.

The combination of these two executables ensures that we have neither false positives nor false negatives about ASAN compilation.

@teo-tsirpanis
Copy link
Member Author

Can we move the greater ASAN validation work to a separate PR and just merge this one? For ease of review, the linker option is already being globally set here:

add_link_options("$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=${TILEDB_SANITIZER}>")

This comment was marked as outdated.

@KiterLuc
Copy link
Contributor

@teo-tsirpanis Let's update the title of this PR and the description to describe what you are trying to accomplish here.

@teo-tsirpanis teo-tsirpanis changed the title Vcpkg - ASAN followup Remove duplicate ASAN linker option. Feb 16, 2024
@teo-tsirpanis
Copy link
Member Author

@KiterLuc done.

@TileDB-Inc TileDB-Inc deleted a comment from shortcut-integration bot Feb 21, 2024
@KiterLuc
Copy link
Contributor

Closing for now. We don't have time to implement proper testing for this at the moment and we have tracking items for this in shortcut.

@KiterLuc KiterLuc closed this Feb 27, 2024
@teo-tsirpanis teo-tsirpanis deleted the teo/asan-fix branch May 28, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants