cargo-deny: Segfault due to libgit2 shenanigans
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
jplatte@jp-desktop ~/code % cargo init t
Created binary (application) package
jplatte@jp-desktop ~/code % cd t
jplatte@jp-desktop ~/code/t (git)-[main] % cargo deny check
2021-11-26 12:48:39 [WARN] unable to find a config path, falling back to default config
[1] 18503 segmentation fault (core dumped) cargo deny check
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-deny
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (13 by maintainers)
The advisory check seems to have broken with Arch’s libgit2 1:1.4.1-1, even when building using
cargo build.gdb backtrace
Downgrading to libgit2 1:1.3.0-1 and
cargo clean && cargo buildseems to fix it.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.
Until
git2can be upgraded to0.14, adding itsvendoredfeature in the meantime also seems to fix the issue. I haven’t tested it withcargo-denyyet but it did work withcargo-edit.Hm, I don’t think I want to take the time right now to go through the code and patch
cargo-denymyself, especially considering it (somehow) works when installed the easy (when developing) way.Might revisit at some later point.