-
Notifications
You must be signed in to change notification settings - Fork 85
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
Segfault due to libgit2 shenanigans #380
Comments
I am unable to repro this. The file is only loaded if it exists, in the code path where that is printed the "config file" is just an empty string, and the rest of the run doesn't know/care that there is no actual file the config was read from. If this still occurs for you I would appreciate having a backtrace, as it stands, I feel like the warning message is maybe a red herring. |
Actually just recently I got the crash again, on a project with a config file so I think you're right about the red herring. Went ahead and uninstalled the arch package / installed from crates.io and it was fixed. I will have a closer look at how the AUR package is built and where it actually crashes. |
Thanks! |
I built a debug version and ran it through GDB, this is the backtrace:
|
This looks to be an issue for others cloudflare/wrangler-legacy#1464, possibly from rust-lang/rust#83994? I'm not really sure what options are available to workaround this, but I suppose you might try pulling the fetch into the main thread and see if waiting on it there might reduce/eliminate the problem? I've never gotten this before so it might be something that is different between versions of openssl/libgit2 on arch versus my distro, but since I can't repro it I'm going to defer to you or someone who can repro it to provide a workaround/fix. |
What is "the fetch" here? |
The code in that callstack is fetching https://github.com/rustsec/advisory-db to disk to check the crate graph for advisories. |
Hm, I don't think I want to take the time right now to go through the code and patch Might revisit at some later point. |
I've looked into it and there's multiple lifetime transmutations going on. I wouldn't be surprised if that's related to the issue at hand. |
The advisory check seems to have broken with Arch's libgit2 1:1.4.1-1, even when building using gdb backtrace
Downgrading to libgit2 1:1.3.0-1 and |
Same crash as @teozkr since Arch's GDB backtrace
|
rust-lang/git2-rs#813 A changed struct seems to be the cause this time around. Unfortunately |
Until |
Maybe an alternative to fixing the problems with |
I would be for that except there are 2 transitive dependencies on libgit2, one via cargo, and I doubt that will ever change. |
Hm, well I haven't seem these segfaults in cargo itself. And I wouldn't think cargo itself will never change. There's actually a tracking issue for features cargo uses in the gitoxide repo. |
If people are blocked by this, support for using the git cli was added in #420 which can be used to workaround this issue in the meantime. |
Describe the bug
It's a segmentation fault! The program crashes after printing a warning about being unable to find a config path. I wanted to just have it use the default config in a project where I haven't set one up yet.
To Reproduce
Expected behavior
Successfully
Additional context
This is cargo-deny 0.10.3 installed to
/usr/bin
through the arch linux package. Maybe it fails to mmap the default config file or something like that? Here's the package build script, it's really minimal: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cargo-denyThe text was updated successfully, but these errors were encountered: