Skip to content
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

cargo segfaults on NFS with git dependencies #3042

Closed
asomers opened this issue Aug 25, 2016 · 14 comments
Closed

cargo segfaults on NFS with git dependencies #3042

asomers opened this issue Aug 25, 2016 · 14 comments
Labels
A-filesystem Area: issues with filesystems A-git Area: anything dealing with git C-bug Category: bug S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

Comments

@asomers
Copy link

asomers commented Aug 25, 2016

On FreeBSD, running "cargo build" on any repo with a git dependency specified in Cargo.toml will segfault. It doesn't matter if the dependency is on github or uses a file:/// url.

cargo version
cargo 0.11.0 (built 2016-07-27)
cargo test
    Updating git repository `https://github.com/asomers/libc`
error: Unable to update https://github.com/asomers/libc?rev=a4721e8

To learn more, run the command again with --verbose.
fish: 'cargo test' terminated by signal SIGSEGV (Address boundary error)

Here is the backtrace from the core file:

#0  0x00000000014c5be1 in ?? ()
#1  0x00000000014da841 in ?? ()
#2  0x00000000014da636 in ?? ()
#3  0x00000008023bb685 in CRYPTO_free (str=0x80521ffa8) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/mem.c:442
#4  0x00000008023b9cb2 in ASN1_STRING_free (a=0x8052add00) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/asn1_lib.c:425
#5  0x00000008023b2bb2 in ASN1_primitive_free (pval=0x8052adcf0, it=0x8052084e8) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:244
#6  0x00000008023b28eb in asn1_item_combine_free (pval=<optimized out>, it=<optimized out>, combine=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:166
#7  0x00000008023b2aac in ASN1_template_free (pval=<optimized out>, tt=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:186
#8  0x00000008023b28eb in asn1_item_combine_free (pval=<optimized out>, it=<optimized out>, combine=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:166
#9  0x00000008023b28eb in asn1_item_combine_free (pval=<optimized out>, it=<optimized out>, combine=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:166
#10 0x00000008023b27d6 in ASN1_item_free (val=<error reading variable: Cannot access memory at address 0x1fe0>, it=0x8052084e8) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/asn1/tasn_fre.c:72
#11 0x00000008022ff793 in cleanup (a=0x8053724a0) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/x509/x509_lu.c:222
#12 0x0000000802303d30 in sk_pop_free (st=<optimized out>, func=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/stack/stack.c:327
#13 0x00000008022ff740 in X509_STORE_free (vfy=<optimized out>) at /usr/src/secure/lib/libcrypto/../../../crypto/openssl/crypto/x509/x509_lu.c:261
#14 0x0000000801eb4156 in SSL_CTX_free (a=0x805238380) at /usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c:2142
#15 0x000000000144f77a in ?? ()
#16 0x000000000143deb1 in ?? ()
#17 0x0000000802deea46 in __cxa_finalize (dso=<optimized out>) at /usr/src/lib/libc/stdlib/atexit.c:237
#18 0x0000000802d7e04c in exit (status=101) at /usr/src/lib/libc/stdlib/exit.c:66
#19 0x00000000014a0ca0 in ?? ()
#20 0x0000000001114801 in ?? ()
#21 0x000000000109a757 in ?? ()
#22 0x00000000010a31e0 in ?? ()
#23 0x000000000109c15c in ?? ()
#24 0x0000000001098f92 in ?? ()
#25 0x00000000014ac079 in ?? ()
#26 0x00000000014b991c in ?? ()
#27 0x00000000014b98bf in ?? ()
#28 0x00000000014abafa in ?? ()
#29 0x0000000001098971 in ?? ()
#30 0x00000008017f0000 in ?? ()
#31 0x0000000000000000 in ?? ()

Using Cargo from git, the result is an assertion error instead of a segfault.

~/src/rust/cargo/target/debug/cargo version
cargo 0.13.0
~/src/rust/cargo/target/debug/cargo test
    Updating git repository `https://github.com/asomers/libc`
Assertion failed: (e->refcount.val == 0), function free_cache_object, file /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/pack.c, line 73.
fish: '~/src/rust/cargo/target/debug/c…' terminated by signal SIGABRT (Abort)

In this case, the core file contains no intelligible stack trace.

My Cargo.toml file contains the following lines. However, every other variation I tried produces the same result, as long as it involves git.

[dependencies]
libc = { git = "https://github.com/asomers/libc", rev="a4721e8"}
@alexcrichton
Copy link
Member

Oh dear, this sounds bad!

Could you try running the test suite of git2-rs and see if there's a smaller test case exhibiting this assertion?

@asomers
Copy link
Author

asomers commented Aug 26, 2016

Nope. In the 0.4.4 and the git head version of git2-rs, all tests pass. I can't build the 0.4 version because of an unresolved import error. However, I did find a test failure in libgit2 that might be related.

libgit2/libgit2#3911

@alexcrichton
Copy link
Member

Definitely sounds fishy! Perhaps you could try building a debug version of Cargo and stepping through the faulting function?

@asomers
Copy link
Author

asomers commented Aug 28, 2016

When I build a debug version of Cargo, gdb can't understand the core file. However, gdb has no problems with a core file made from a release version of gdb. Odd. But I did manage to get a stack trace from the debug version by setting a breakpoint at the assertion that fails. Unfortunately, the bug is a refcount mismatch in a structure deep within the bowels of libgit2. As such, it's beyond my ability to debug. I'm afraid that it's going to take a libgit2 expert.

> #0  free_cache_object (o=0x805cc7210) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/pack.c:73
> #1  0x00000000018f2411 in cache_free (cache=0x805d036f0) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/pack.c:86
> #2  0x00000000018f231c in git_packfile_free (p=0x805d03680) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/pack.c:992
> #3  0x000000000194800e in git_mwindow_put_pack (pack=0x805d03680) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/mwindow.c:128
> #4  0x00000000018e8111 in pack_backend__free (_backend=0x805ccdc00) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/odb_pack.c:533
> #5  0x00000000018e4347 in odb_free ()
> #6  0x00000000018e42c2 in git_odb_free ()
> #7  0x000000000190251c in set_odb (repo=0x805c598a0, odb=0x805a46dc0) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/repository.c:63
> #8  0x000000000190239b in git_repository__cleanup (repo=0x805c598a0) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/repository.c:117
> #9  0x00000000019025d5 in git_repository_free (repo=0x805c598a0) at /usr/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.5/libgit2/src/repository.c:128
> #10 0x00000000018aa9d8 in git2::repo::{{impl}}::drop (self=0x7fffffff0930) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.4.4/src/repo.rs:1700
> #11 0x0000000001419afd in git2..Repository::drop.43884::hdda813d727d29064 ()
> #12 0x0000000001607bd4 in sources..git..utils..GitDatabase::drop.48956::h4fa91c402b197326 ()
> #13 0x00000000011fec80 in _$LT$sources..git..source..GitSource$LT$$u27$cfg$GT$$u20$as$u20$core..source..Source$GT$::update::hd77cec083b7cd665 ()
> #14 0x0000000001300912 in cargo::core::registry::PackageRegistry::load::_$u7b$$u7b$closure$u7d$$u7d$::he53950680ace08c8 ()
> #15 0x000000000130098d in extern$u20$$u22$rust.call$u22$$u20$fn$LP$$u5b$closure$SP$src$u2f$cargo$u2f$core$u2f$registry.rs.176.9.$u20$187.11$u20$self.$RF$$u27$static$u20$mut$u20$$RF$$u27$static$u20$mut$u20$core..registry..PackageRegistry$LT$$u27$static$GT$$C$$u20$source_id.$RF$$u27$static$u20$$RF$$u27$static$u20$core..source..SourceId$C$$u20$kind.$RF$$u27$static$u20$core..registry..Kind$u5d$$C$$u20$$LP$$RP$$RP$$u20$.$GT$$u20$std..result..Result$LT$$LP$$RP$$C$$u20$Box$LT$util..errors..CargoError$u20$$u2b$$u20$$u27$static$GT$$GT$::once_shim.40630::h933b4c9aae749c5d ()
> #16 0x00000000012ffc8d in _$LT$F$u20$as$u20$util..errors..ChainError$LT$T$GT$$GT$::chain_error::h18f7abb78a257ad7 ()
> #17 0x00000000012f18ab in cargo::core::registry::PackageRegistry::load::h6c3f46ffd916c95d ()
> #18 0x00000000012f07d6 in cargo::core::registry::PackageRegistry::ensure_loaded::hcc3656632f6462d4 ()
> #19 0x0000000001306e8b in _$LT$core..registry..PackageRegistry$LT$$u27$cfg$GT$$u20$as$u20$core..registry..Registry$GT$::query::h470044f9865772b2 ()
> #20 0x0000000001295af7 in cargo::core::resolver::Context::query::haf23c048198cfa13 ()
> #21 0x0000000001294779 in cargo::core::resolver::Context::build_deps::_$u7b$$u7b$closure$u7d$$u7d$::h38da1e9044856445 ()
> #22 0x0000000001294609 in core::ops::impls::_$LT$impl$u20$std..ops..FnOnce$LT$A$GT$$u20$for$u20$$RF$$u27$a$u20$mut$u20$F$GT$::call_once::h76547c815785738d ()
> #23 0x00000000012944eb in _$LT$std..option..Option$LT$T$GT$$GT$::map::hcda37f6e37edbfe1 ()
> #24 0x000000000129444f in _$LT$std..iter..Map$LT$I$C$$u20$F$GT$$u20$as$u20$std..iter..Iterator$GT$::next::h302db353e370b30c ()
> #25 0x0000000001294216 in _$LT$$LT$std..result..Result$LT$V$C$$u20$E$GT$$u20$as$u20$std..iter..FromIterator$LT$std..result..Result$LT$A$C$$u20$E$GT$$GT$$GT$..from_iter..Adapter$LT$Iter$C$$u20$E$GT$$u20$as$u20$std..iter..Iterator$GT$::next::h1bb44f23f6578855 ()
> #26 0x00000000012941df in _$LT$$RF$$u27$a$u20$mut$u20$I$u20$as$u20$std..iter..Iterator$GT$::next::hb4e3e9346a73cb2c ()
> #27 0x000000000129505b in _$LT$std..vec..Vec$LT$T$GT$$GT$::extend_desugared::hbde4df6c20c592f6 ()
> #28 0x000000000129412f in _$LT$std..vec..Vec$LT$T$GT$$u20$as$u20$std..iter..FromIterator$LT$T$GT$$GT$::from_iter::hc2cac91186743725 ()
> #29 0x0000000001293862 in _$LT$std..result..Result$LT$V$C$$u20$E$GT$$u20$as$u20$std..iter..FromIterator$LT$std..result..Result$LT$A$C$$u20$E$GT$$GT$$GT$::from_iter::hcdc19b1783a793ea ()
> #30 0x00000000012936f3 in core::iter::iterator::Iterator::collect::h4a876d4069282243 ()
> #31 0x000000000126ee6e in cargo::core::resolver::Context::build_deps::h99af12331a1d2add ()
> #32 0x00000000012626bd in cargo::core::resolver::activate::h1e69af3f16829146 ()
> #33 0x0000000001259439 in cargo::core::resolver::activate_deps_loop::h0ae3648f1012c7f2 ()
> #34 0x0000000001256a51 in cargo::core::resolver::resolve::h2c90c965d4960b85 ()
> #35 0x000000000134c3f8 in cargo::ops::resolve::resolve_with_previous::h70e55ec8e1e41554 ()
> #36 0x0000000001331207 in cargo::ops::resolve::resolve_ws::hfc62e85c7c05d850 ()
> #37 0x0000000001349c39 in cargo::ops::cargo_compile::resolve_dependencies::hcbb8cdbc75083d0f ()
> #38 0x0000000001346e7a in cargo::ops::cargo_compile::compile_ws::h127ee0c267563315 ()
> #39 0x000000000134542e in cargo::ops::cargo_compile::compile::h14faf6e2d9d049be ()
> #40 0x000000000158e1d3 in cargo::ops::cargo_test::compile_tests::h225dac33512adcf6 ()
> #41 0x000000000158d59c in cargo::ops::cargo_test::run_tests::h0c5f717fdcacdf65 ()
> #42 0x00000000011a0bf0 in cargo::test::execute (options=Options = {...}, config=0x7fffffffe6c8) at src/bin/test.rs:130
> #43 0x000000000119a87a in cargo::call_main_without_stdin<cargo::test::Options,()> (exec=0x119fd30 <cargo::test::execute>, config=0x7fffffffe6c8, usage="...", args=&[collections::string::String](len: 2) = {...}, options_first=true) at src/cargo/lib.rs:71
> #47 0x00000000010cd227 in cargo::execute_main_without_stdin::_$u7b$$u7b$closure$u7d$$u7d$::hf7886269c7efcc62 () at src/libcore/cmp.rs:509
> #48 0x00000000010c8839 in cargo::process::_$u7b$$u7b$closure$u7d$$u7d$::hd21227d3eb2334d2 () at src/libcore/result.rs:29
> #49 0x00000000010c808a in cargo::process<(),closure> (callback=closure = {...}) at src/cargo/lib.rs:79
> #50 0x00000000010c8010 in cargo::execute_main_without_stdin<cargo::Flags,()> (exec=0x10dae70 <cargo::execute>, options_first=true, usage="...",) at src/cargo/lib.rs:57
> #51 0x00000000010c7d5e in cargo::main () at src/bin/cargo.rs:71
> #52 0x0000000001b31429 in std::panicking::try::call::hbbf4746cba890ca7 ()
> #53 0x0000000001b3eccc in __rust_try ()
> #54 0x0000000001b3ec6f in __rust_maybe_catch_panic ()
> #55 0x0000000001b30eaa in std::rt::lang_start::hbcefdc316c2fbd45 ()
> #56 0x00000000010dd0ea in main () at src/bin/cargo.rs:220

@alexcrichton
Copy link
Member

We are falling a bit behind on libgit2's latest version at this point, so this could very well be a bug that's been fixed in master. Unfortunately it won't be trivial to update, so it may be difficult to test out

@asomers
Copy link
Author

asomers commented Oct 3, 2016

FYI, libgit2 just fixed an issue that may be related: libgit2/libgit2#3931

@alexcrichton
Copy link
Member

@asomers I've opened #3174 which updates libgit2 to include that commit you've referenced. Want to give it a spin after it merges?

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Oct 6, 2016
Pull in the next major version of the `openssl` crate as well as the `git2`
crate which is targeted at helping to fix rust-lang#3042
@asomers
Copy link
Author

asomers commented Nov 19, 2016

Update: FreeBSD is not the culprit; NFS is. I have a FreeBSD server 10.3, a FreeBSD 11.0 client, and an Ubuntu 16.10 client. All three systems can use cargo with git dependencies when CARGO_HOME points to a local file system. However, both clients get the same segfault when CARGO_HOME points to an NFSv4 mount, served by the FreeBSD 10.3 server.

@asomers asomers changed the title cargo segfaults on FreeBSD with git dependencies cargo segfaults on NFSv4 with git dependencies Nov 19, 2016
@alexcrichton
Copy link
Member

Interesting! If you can narrow down with the segfault is we can hopefully report upstream to libgit2

@asomers asomers changed the title cargo segfaults on NFSv4 with git dependencies cargo segfaults on NFS with git dependencies Dec 5, 2016
@asomers
Copy link
Author

asomers commented Dec 5, 2016

Here's a stack trace from the latest master branch of cargo. It's failing with SIGABRT now instead of SIGSEGV. And BTW, it fails on NFSv3 as well as NFSv4. Am I really the first person to use cargo with CARGOHOME on an NFS share?

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58                                                                                                                     
#1  0x00007f085eae53ea in __GI_abort () at abort.c:89                                                                                                                                         
#2  0x00007f085eadbbb7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x558135673e52 "e->refcount.val == 0",                                                           
    file=file@entry=0x558135673df0 "/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/pack.c", line=line@entry=73,                                   
    function=function@entry=0x558135674250 <__PRETTY_FUNCTION__.8671> "free_cache_object") at assert.c:92                                                                                     
#3  0x00007f085eadbc62 in __GI___assert_fail (assertion=0x558135673e52 "e->refcount.val == 0", 
    file=0x558135673df0 "/home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/pack.c", line=73, 
    function=0x558135674250 <__PRETTY_FUNCTION__.8671> "free_cache_object") at assert.c:101
#4  0x0000558135241d05 in free_cache_object (o=0x7f085d7fc580) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/pack.c:73
#5  0x0000558135241d9d in cache_free (cache=0x7f085e2cbc10) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/pack.c:86
#6  0x0000558135243e5d in git_packfile_free (p=0x7f085e2cbb80) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/pack.c:994
#7  0x0000558135232206 in git_mwindow_put_pack (pack=0x7f085e2cbb80) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/mwindow.c:117
#8  0x0000558135239753 in pack_backend__free (_backend=0x7f085d7970c0) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/odb_pack.c:560
#9  0x0000558135234fab in odb_free (db=0x7f085d6cd900) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/odb.c:632
#10 0x0000558135235053 in git_odb_free (db=0x7f085d6cd900) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/odb.c:649
#11 0x0000558135253065 in set_odb (repo=0x7f085d717100, odb=0x7f085d6cd900) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/repository.c:63
#12 0x0000558135253239 in git_repository__cleanup (repo=0x7f085d717100) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/repository.c:117
#13 0x0000558135253270 in git_repository_free (repo=0x7f085d717100) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.6.4/libgit2/src/repository.c:128
#14 0x000055813517d020 in git2::repo::{{impl}}::drop (self=0x7ffeabe21c60) at /home/somers/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.6.3/src/repo.rs:1727
#15 0x0000558134cb08c1 in drop::h241a0d3ccfd271de ()
#16 0x0000558134cb140b in drop::h2b754ae5e6e8990c ()
#17 0x0000558135001fa4 in cargo::sources::git::source::{{impl}}::update (self=0x7f085d68d9c0) at /home/somers/src/rust/cargo/src/cargo/sources/git/source.rs:139
#18 0x00005581350d7457 in cargo::core::registry::{{impl}}::load::{{closure}} () at /home/somers/src/rust/cargo/src/cargo/core/registry.rs:190
#19 0x00005581350ec654 in core::ops::FnOnce::call_once::hcc97604d0dff5d19 () at /home/somers/src/rust/cargo/src/cargo/ops/cargo_generate_lockfile.rs:85
#20 0x000055813502d892 in cargo::util::errors::{{impl}}::chain_error<(),closure,Box<CargoError>,closure> (self=closure = {...}, callback=closure = {...})
    at /home/somers/src/rust/cargo/src/cargo/util/errors.rs:56
#21 0x0000558134f4f897 in cargo::core::registry::PackageRegistry::load (self=0x7ffeabe29928, source_id=0x7f085e2a9628, kind=cargo::core::registry::Kind::Normal)
    at /home/somers/src/rust/cargo/src/cargo/core/registry.rs:180
#22 0x0000558134f4e108 in cargo::core::registry::PackageRegistry::ensure_loaded (self=0x7ffeabe29928, namespace=0x7f085e2a9628, kind=cargo::core::registry::Kind::Normal)
    at /home/somers/src/rust/cargo/src/cargo/core/registry.rs:141
#23 0x0000558134f51282 in cargo::core::registry::{{impl}}::query (self=0x7ffeabe29928, dep=0x7ffeabe23290) at /home/somers/src/rust/cargo/src/cargo/core/registry.rs:338
#24 0x0000558134f397b9 in cargo::core::resolver::Context::query (self=0x7ffeabe25bc0, registry=&mut Registry, dep=0x7ffeabe23290)
    at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:850
#25 0x00005581350a5bfd in cargo::core::resolver::{{impl}}::build_deps::{{closure}} () at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:823
#26 0x0000558134c7351b in core::ops::impls::{{impl}}::call_once<((cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)),closure> (self=0x7ffeabe23ba0, 
    args={...}) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/ops.rs:2644
#27 0x0000558134b47e02 in core::option::Option<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>::map<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>),core::result::Result<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>), Box<CargoError>>,&mut closure> (self=Some = {...}, f=0x7ffeabe23ba0) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/option.rs:383
#28 0x0000558134e99014 in core::iter::{{impl}}::next<core::result::Result<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>), Box<CargoError>>,collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>,closure> (
    self=0x7ffeabe23b80) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/iter/mod.rs:896
#29 0x0000558134b0aac4 in core::result::{{impl}}::from_iter::{{impl}}::next<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>),Box<CargoError>,core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>> (self=0x7ffeabe23b80) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/result.rs:1002
#30 0x0000558134df2e0f in core::iter::iterator::{{impl}}::next<core::result::{{impl}}::from_iter::Adapter<core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>, Box<CargoError>>> (self=0x7ffeabe23880)
    at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/iter/iterator.rs:2146
#31 0x0000558134b7ca91 in collections::vec::Vec<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>)>::extend_desugared<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>),&mut core::result::{{impl}}::from_iter::Adapter<core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>, Box<CargoError>>> (self=0x7ffeabe23a40, iterator=0x7ffeabe23b80) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcollections/vec.rs:1557
#32 0x0000558134efbb00 in collections::vec::{{impl}}::from_iter<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>),&mut core::result::{{impl}}::from_iter::Adapter<core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>, Box<CargoError>>> (iter=0x7ffeabe23b80) at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcollections/vec.rs:1465
#33 0x0000558134acad0f in core::result::{{impl}}::from_iter<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>),Box<CargoError>,collections::vec::Vec<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>)>,core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>> (
    iter=Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure> = {...})
    at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/result.rs:1014
#34 0x0000558134c9edd5 in core::iter::iterator::Iterator::collect<core::iter::Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure>,core::result::Result<collections::vec::Vec<(cargo::core::dependency::Dependency, collections::vec::Vec<cargo::core::resolver::Candidate>, collections::vec::Vec<collections::string::String>)>, Box<CargoError>>> (self=Map<collections::vec::IntoIter<(cargo::core::dependency::Dependency, collections::vec::Vec<collections::string::String>)>, closure> = {...})
    at /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/obj/../src/libcore/iter/iterator.rs:1200
#35 0x0000558134f39359 in cargo::core::resolver::Context::build_deps (self=0x7ffeabe25bc0, registry=&mut Registry, candidate=0x7f085d69c890, method=0x7f085d6cc060)
    at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:822
#36 0x0000558134f3158c in cargo::core::resolver::activate (cx=0x7ffeabe25bc0, registry=&mut Registry, parent=None, candidate=Candidate = {...}, method=0x7f085d6cc060)
    at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:331
#37 0x0000558134f327da in cargo::core::resolver::activate_deps_loop (cx=Context = {...}, registry=&mut Registry, 
    summaries=&[(cargo::core::summary::Summary, cargo::core::resolver::Method)](len: 1) = {...}) at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:448
#38 0x0000558134f2fb07 in cargo::core::resolver::resolve (summaries=&[(cargo::core::summary::Summary, cargo::core::resolver::Method)](len: 1) = {...}, 
    replacements=&[(cargo::core::package_id_spec::PackageIdSpec, cargo::core::dependency::Dependency)](len: 0), registry=&mut Registry)
    at /home/somers/src/rust/cargo/src/cargo/core/resolver/mod.rs:272
#39 0x0000558134feeb0e in cargo::ops::resolve::resolve_with_previous (registry=0x7ffeabe29928, ws=0x7ffeabe2d230, method=Everything, previous=Some = {...}, to_avoid=None, 
    specs=&[cargo::core::package_id_spec::PackageIdSpec](len: 0)) at /home/somers/src/rust/cargo/src/cargo/ops/resolve.rs:156
#40 0x0000558134fed672 in cargo::ops::resolve::resolve_ws (registry=0x7ffeabe29928, ws=0x7ffeabe2d230) at /home/somers/src/rust/cargo/src/cargo/ops/resolve.rs:17
Python Exception <class 'TypeError'> Could not convert Python object: None.: 
#41 0x0000558134f63a9b in cargo::ops::cargo_compile::resolve_dependencies (ws=0x7ffeabe2d230, source=..., features=&[collections::string::String](len: 0), all_features=false, 
    no_default_features=false, specs=&[cargo::core::package_id_spec::PackageIdSpec](len: 0)) at /home/somers/src/rust/cargo/src/cargo/ops/cargo_compile.rs:121
Python Exception <class 'TypeError'> Could not convert Python object: None.: 
#42 0x0000558134f65240 in cargo::ops::cargo_compile::compile_ws (ws=0x7ffeabe2d230, source=..., options=0x7ffeabe2d2c8) at /home/somers/src/rust/cargo/src/cargo/ops/cargo_compile.rs:177
#43 0x0000558134f63370 in cargo::ops::cargo_compile::compile (ws=0x7ffeabe2d230, options=0x7ffeabe2d2c8) at /home/somers/src/rust/cargo/src/cargo/ops/cargo_compile.rs:98
#44 0x00005581349d4241 in cargo::build::execute (options=Options = {...}, config=0x7ffeabe31d58) at /home/somers/src/rust/cargo/src/bin/cargo.rs:111
#45 0x000055813496f4a1 in cargo::call_main_without_stdin<cargo::build::Options,()> (exec=0x5581349d35d0 <cargo::build::execute>, config=0x7ffeabe31d58, usage="

@alexcrichton
Copy link
Member

Thanks for the trace @asomers! Could you also clarify what version of Cargo that was collected with?

@alexcrichton
Copy link
Member

I've filed an upstream bug as well at libgit2/libgit2#4023 to hopefully get to the bottom of this.

@asomers
Copy link
Author

asomers commented Dec 7, 2016

@alexcrichton I've seen the failure with multiple versions of cargo, most recently f33b7b0 .

@carols10cents carols10cents added A-git Area: anything dealing with git blocked C-bug Category: bug labels Sep 26, 2017
@ehuss ehuss added S-blocked and removed blocked labels Oct 10, 2019
@weihanglo weihanglo added A-filesystem Area: issues with filesystems S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix and removed S-blocked labels Apr 18, 2023
@asomers
Copy link
Author

asomers commented May 16, 2024

It's been > 7 years since I filed this bug, and I don't recall seeing it for a very long time. I still use CARGO_HOME on NFS, and it works these days. I'm going the close the bug.

@asomers asomers closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filesystem Area: issues with filesystems A-git Area: anything dealing with git C-bug Category: bug S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants