{"thread":{"id":"64878","subject":"workaround for git maintenance systemd services not exiting when git is built with address sanitizer","startedAt":"2026-01-28T01:45:23Z","lastAt":"2026-01-28T01:45:23Z","messageCount":1,"participants":["Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"534739","messageId":"be156fc6-169b-4cc4-b44b-c77360c44d75@intel.com","threadId":"64878","inReplyTo":null,"subject":"workaround for git maintenance systemd services not exiting when git is built with address sanitizer","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2026-01-28T01:45:12Z","receivedAt":"2026-01-28T01:45:23Z","isPatch":false,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"Hi,\n\nI recently tried to enable git maintenance for some repositories on one \nof my systems.\n\nThe services appeared to execute once but then the git processes got \nstuck the services never exited.\n\nI tried various things to figure out what was going on including strace \non the processes. This showed that the git process was constantly \ncalling sched_yield().\n\nI then connected to the process with gdb and took a backtrace:\n\n>    $ gdb -p 1344308\n>    (gdb) bt\n>    #0  0x00007fe6058e9beb in sched_yield () from /lib64/libc.so.6\n>    #1  0x00007fe606312fe5 in __sanitizer::StopTheWorld(void (*)(__sanitizer::SuspendedThreadsList const&, void*), void*) () from /lib64/libasan.so.8\n>    #2  0x00007fe60632685e in __lsan::LockStuffAndStopTheWorldCallback(dl_phdr_info*, unsigned long, void*) () from /lib64/libasan.so.8\n>    #3  0x00007fe605950197 in dl_iterate_phdr () from /lib64/libc.so.6\n>    #4  0x00007fe606326bb0 in __lsan::LockStuffAndStopTheWorld(void (*)(__sanitizer::SuspendedThreadsList const&, void*), __lsan::CheckForLeaksParam*) ()\n>       from /lib64/libasan.so.8\n>    #5  0x00007fe6063235d2 in __lsan::CheckForLeaksOnce() () from /lib64/libasan.so.8\n>    #6  0x00007fe606323835 in __lsan::DoLeakCheck() () from /lib64/libasan.so.8\n>    #7  0x00007fe60582943c in __cxa_finalize () from /lib64/libc.so.6\n>    #8  0x00007fe606205c87 in __do_global_dtors_aux () from /lib64/libasan.so.8\n>    #9  0x00007ffd86656ba0 in ?? ()\n>    #10 0x00007fe606a6d2d2 in _dl_call_fini (closure_map=0x7fe606a620c0) at dl-call_fini.c:43\n\nThis shows that we appear to get stuck inside of the leak sanitizer for \nsome reason.\n\nI build git locally and enable the sanitizer, which helps me catch \nissues both when developing and running git.\n\nI don't really understand why, but some google searching shows that it \ncould be related to some of the way that systemd sets up and isolates \nthe process.\n\nThe end result of this setup is that my git maintenance processes run \nonce then never exit, so systemd service never stops, so the timer never \nrestarts git maintenance on the next hour/day/etc.\n\nI was able to work around this by adding an override.conf with\n\n[Service]\nEnvironment=\"ASAN_OPTIONS=detect_leaks=0\"\n\nWhich disables the asan leak detection, and prevents this particular issue.\n\nI thought I'd post this so that anyone else running into this issue \nmight hopefully find the fix or workaround instead of wondering why git \nwas getting stuck doing nothing for days on end.\n"}]}