From 09402100946e6892ebd1e75773eb390cdd7f28ab Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 12 May 2023 13:14:26 +0200 Subject: memcheck: fix race in libgit2... ...caused by incorrectly setting and resetting the library internal state and the misuse of pthreads in libgit2. Normally, git_libgit2_init and git_libgit2_shutdown should span the life of a worker thread in order to be safely used. However, due to an incorrect implementation of libgit2's threadstate with pthreads, on unix systems there is a race condition. Until the use of pthread_key_t is corrected in libgit2, we need to apply a workaround by always ensuring that the main thread is the first thread reaching the GitContext constructor. --- test/other_tools/git_operations/git_config_run.test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/other_tools/git_operations/git_config_run.test.cpp') diff --git a/test/other_tools/git_operations/git_config_run.test.cpp b/test/other_tools/git_operations/git_config_run.test.cpp index 8ffd744a..956b8926 100644 --- a/test/other_tools/git_operations/git_config_run.test.cpp +++ b/test/other_tools/git_operations/git_config_run.test.cpp @@ -45,7 +45,7 @@ auto main(int argc, char* argv[]) -> int { ConfigureLogging(); // start a git context, needed to read in the config file - GitContext context{}; + GitContext::Create(); // handle args if (argc < 3) { -- cgit v1.2.3