rust-lang / cargo-bisect-rustc

Bisects rustc, either nightlies or CI artifacts
https://rust-lang.github.io/cargo-bisect-rustc/
Apache License 2.0
177 stars 55 forks source link

Segmentation fault when cloning rust repository on systems with libgit2 >= 1.4.0 #154

Closed LingMan closed 2 years ago

LingMan commented 2 years ago

TLDR: git2 dependency update needed. Will post a PR shortly, this issue is just for the record.

Reproduction:

pub fn g( a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: () ) -> () { }

fn main() { }

- Run a successful bisection. Do NOT set the `RUST_SRC_REPO` environment variable here either. If you use the example from above run
`cargo bisect-rustc --regress=ice --start=2022-04-16 --end=2022-04-17`
The last output before the segfault should be `cloning rust repository`.
The segfault itself happens at this line:
https://github.com/rust-lang/cargo-bisect-rustc/blob/51b048455074007af6082918d065701e34e83935/src/git.rs#L95

The stacktrace for me was:

Stack trace of thread 170034:

0 0x00007f5edef15260 n/a (libgit2.so.1.4 + 0xa4260)

            #1  0x00007f5edef16d6e git_remote_fetch (libgit2.so.1.4 + 0xa5d6e)
            #2  0x00007f5edeea20ac n/a (libgit2.so.1.4 + 0x310ac)
            #3  0x000055ef51df2d15 n/a (/home/username/.cargo/bin/cargo-bisect-rustc + 0x18bd15)


Thankfully the problem was already reported to git2 in https://github.com/rust-lang/git2-rs/issues/813 and fixed. We just need to update the dependency. As mentioned at the beginning, I'll submit a PR shortly.