-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LibGit2 segfault on exit #20109
Comments
cc: @tkelman |
yes, just bisected to #19660 from running |
It's kind of weird. It goes away if I manually close the objects before exiting. But not if I just close just the |
And I still see the problem if I revert to libgit2 v0.24.5 |
@tkelman do you only see the segfault at exit as well? |
So far, yeah |
Yeah, it seems to be something funny happening at exit. e.g.
works fine. But if I leave off the |
It goes away if I disable this |
Yup, that's it:
|
@yuyichao You mentioned in this discussion that it might be possible to add post-finalize atexit functions? How feasible would this be? |
Does that function also cleanup all of the libgit2 objects? I think you could just set a flag before calling shutdown, and return early from any finalizers afterwards |
No it doesn't, all objects need to be cleaned up before calling |
That can be hard to specify what you can do and what you can't in it so I'd rather not unless it's really necessary. I think you should just refcount the global context in the libgit2 object constructor and finalizers. |
Fixes segfault from calling `git_libgit2_shutdown` before finalizers (#20109).
Should be fixed by #20124. |
Confirming that |
I seem to be getting segfaults when Julia exits, and there are LibGit2 finalizers to be run (probably due to #19660).
e.g. from within current Julia git directory, this reliably causes a segfault on my machine:
The text was updated successfully, but these errors were encountered: