cargo-outdated icon indicating copy to clipboard operation
cargo-outdated copied to clipboard

Segmentation fault for project with private ssh dependencies

Open klefevre opened this issue 8 years ago • 5 comments

Hi, It seems that private dependencies with an ssh url cause a segmentation fault. I thought private dependencies wasn't supported but I checked with https urls and it works fine.

[dependencies]
dummy1 = { git="ssh://[email protected]/klefevre/dummy.git" } // make crash cargo-outdated
dummy2 = { git="https://github.com/klefevre/dummy.git" } // works

klefevre avatar Oct 30 '17 10:10 klefevre

Is it really a cargo outdated-specific issue? I deem if cargo runs normally then things won't go wrong with cargo outdated.

I tested a private repo on my own and it was all fine. The authentication was provided by ssh-agent.

Actually no matter what you use, as long as git clone repo_uri works without prompting you for credentials, it should be safe to put it in the manifest.

Frederick888 avatar Nov 23 '17 10:11 Frederick888

I have also ssh-agent activated and I can clone any ssh repository without any credentials request.

The only "strange" thing I could see is that i'm on macOS and my ssh key has a passphrase and is managed by the keychain. But even with this, which is a very common configuration, I can run cargo without troubles.

Here you could see a sample of my ssh config:

Host *
    AddKeysToAgent yes
    UseKeychain yes

klefevre avatar Nov 29 '17 11:11 klefevre

But, I mean... Does cargo builtins work normally? Is it cargo-outdated-specific? For instance, does cargo update work normally?

I have a Macbook but I never use KeyChain to manage these kind of stuff. If it is cargo-outdated-specific I can try to reproduce issue in macOS.

Frederick888 avatar Nov 29 '17 12:11 Frederick888

As I said I can run cargo without any troubles i.e. running cargo update works normally. So I guess it comes from cargo-outdated.

klefevre avatar Nov 29 '17 13:11 klefevre

I digged a little bit and I found that the crash from the cargo crate.

$ RUST_LOG=trace cargo outdated
....
DEBUG:cargo::core::registry: load/missing  ssh://[email protected]/klefevre/xxxx-rs?rev=e8e31fd
DEBUG:cargo::sources::config: loading: ssh://[email protected]/klefevre/xxxx-rs?rev=e8e31fd
TRACE:cargo::core::source: loading SourceId; ssh://[email protected]/klefevre/xxxx-rs?rev=e8e31fd
TRACE:cargo::sources::git::source: updating git source `GitRemote { url: "ssh://[email protected]/klefevre/xxxx-rs" }`
[1]    96398 segmentation fault  RUST_LOG=trace cargo outdated

I looked where exactly the crash happen in cargo and it appeared that it's a call on git2-rs that crash (precisely there https://github.com/alexcrichton/git2-rs/blob/master/src/remote.rs#L232 ) .

I don't know for you but I'm currently on High Sierra, and it might be related to this version of macOS only.

All that to say that it's not a cargo-outdated bug so I guess you can close the issue unless you want to keep it for reference.

klefevre avatar Nov 29 '17 18:11 klefevre