-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Description
- git__getenv: utf-8 aware env reader #3288 introduced
git__getenv, which introduced a bit more error handling in environment lookup than we had before. - In POSIX,
git_libgit2_initcallsinit_oncebefore incrementinggit__n_inits. ()Line 347 in 42156d5
pthread_once(&_once_init, init_once); init_oncecalls various other init functions: https://github.com/libgit2/libgit2/blob/42156d561723e92ffe597885719aa63abfe0795c/src/global.c#L334-338- Some of those global init functions (namely
git_sysdir_global_init) can error (), which means we try to clear theLine 34 in ea445e0
if (error == GIT_ENOTFOUND) { last_error. - Setting the
last_erroraccessesgit__global_state().Line 108 in c7f9412
if (GIT_GLOBAL->last_error != NULL) { git__global_stateasserts thatgit__n_inits > 0()Line 383 in 42156d5
assert(git_atomic_get(&git__n_inits) > 0); - 💥 We fail the assertion.