Skip to content

CDRIVER-3620 Remove Valgrind tests from Evergreen #1177

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

Merged
merged 10 commits into from
Jan 13, 2023

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Jan 12, 2023

This PR is a part of CDRIVER-3620. Verified by this patch.

Valgrind tasks regularly time out on Evergreen due to requiring over 4 hours of runtime even with "slow" tests disabled, severely limiting their value. This PR removes Valgrind from Evergreen (and relevant documentation) entirely in favor of existing ASAN/UBSAN tasks.

This results in the removal of two variants:

  • valgrind-ubuntu (Valgrind Tests (Ubuntu 18.04))
  • valgrind-ubuntu-1404 (Valgrind Tests - MongoDB (pre 4.0) (Ubuntu 14.04))

And the removal of the debug-compile-valgrind task.

The authentication-tests-memcheck task was redefined to use ASAN instead of Valgrind. However, GCC 7.5 on Ubuntu 18.04 was observed to fail due to incomprehensible stack-buffer-overflow, stack-use-after-return, and other miscellaneous errors that are not reproducible with Clang (even on the same environment when tested via spawn host). The task with GCC 7.5 was therefore removed on grounds of false-positive behavior (possibly this bug?). An attempt to use a newer GCC version on a newer Ubuntu distro was made but abandoned due to complications with registering/parsing certificates.

To silence unhelpful <unknown module> leaks, the workaround previously applied specifically to mongcryptd was generalized into a bypass-dlclose.sh script which wraps a provided command with LD_PRELOAD set appropriately. This is applied only to tests run on Evergreen; changes to the CMake configuration were deliberately avoided to prevent introducing downstream effects.

@eramongodb eramongodb requested a review from kevinAlbs January 12, 2023 17:53
@eramongodb eramongodb self-assigned this Jan 12, 2023
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

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

LGTM.

Re: Spurious ASan failures: Were you sure to disable the extra-alignment option for libbson?

@eramongodb
Copy link
Contributor Author

Were you sure to disable the extra-alignment option for libbson?

Good call. Confirmed the task succeeds given -DENABLE_EXTRA_ALIGNMENT=OFF. Will restore the task with appropriate config changes.

@eramongodb
Copy link
Contributor Author

Took the opportunity to group the authentication-tests-memcheck task into the same ubuntu1804 distro, effectively upgrading the Clang version used from 3.6 to 6.0. Latest changes verified by this patch.

else
./.libs/test-libbson "--no-fork $TEST_ARGS"
fi
./.libs/test-libbson "--no-fork $TEST_ARGS"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test-libbson target appears to no longer exist.

This script is only called by the run tests bson Evergreen function. run tests bson appears unused.

Suggest removing run-tests-bson.sh and the run tests bson Evergreen function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. This is known and will be addressed in a separate PR along with other unused scripts/functions/tasks.

@@ -127,7 +127,7 @@ typedef struct _bson_json_opts_t bson_json_opts_t;
BSON_ALIGNED_BEGIN (128) typedef struct _bson_t {
uint32_t flags; /* Internal flags for the bson_t. */
uint32_t len; /* Length of BSON data. */
char *canary; /* For valgrind check */
char *canary; /* For memcheck. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
char *canary; /* For memcheck. */
char *canary; /* For leak sanitizer. */

memcheck is the tool in Valgrind. LeakSanitizer is the tool in ASAN.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given we no longer use Valgrind, I was re-defining "memcheck" to simply mean "memory (leak) checks" rather than the Valgrind tool. Should tasks also be renamed to avoid using the now-inapplicable memcheck terminology?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I vote yes. Maybe rename the tasks to authentication-tests-lsan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LSAN was merged into ASAN and is automatically enabled when supported, so for consistency with test-asan-memcheck-mock-server I think authentication-tests-asan-memcheck would probably be most appropriate. I will also reword the comment to For leak checks.

# "$@": command and arguments to evaluate.
# "$CC": compiler to use to compile and link the bypass_dlclose library.
#
# Evaluates the provided command and arguments with LD_PRELOAD defined to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incomplete sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops. Will fix.

@eramongodb eramongodb requested a review from kevinAlbs January 13, 2023 17:40
@eramongodb eramongodb merged commit c796edd into mongodb:master Jan 13, 2023
@eramongodb eramongodb deleted the cdriver-valgrind branch January 13, 2023 17:43
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