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

libz-ng: illegal instruction on x86_64-unkown-linux-{musl, gnu} #148

Open
NobodyXu opened this issue Aug 1, 2023 · 4 comments
Open

libz-ng: illegal instruction on x86_64-unkown-linux-{musl, gnu} #148

NobodyXu opened this issue Aug 1, 2023 · 4 comments
Labels
help wanted question There is a question to be answered

Comments

@NobodyXu
Copy link
Contributor

NobodyXu commented Aug 1, 2023

cargo-binstall, which uses gix v0.50.1 and depends on libz-ng get killed by illegal instructions on this CI and also this one:

+ ./cargo-binstall binstall --force --git file:///tmp/tmp.iyk2axDWcq --no-confirm cargo-binstall
 INFO resolve: Resolving package: 'cargo-binstall'
 INFO Cloning::receiving pack: Enumerating objects → 3.0 objects
git.sh: line 39: 24033 Illegal instruction     (core dumped) "./$1" binstall --force --git "file://$GIT" --no-confirm cargo-binstall

I disabled the flate2/zlib-ng and it fixed the issue.

Also reported here: GitoxideLabs/gitoxide#955

@NobodyXu
Copy link
Contributor Author

NobodyXu commented Aug 2, 2023

The cargo-binstall is built using the following commands:

export CARGO_PROFILE_RELEASE_LTO=no
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1024
export RUSTFLAGS='-C link-arg=-static-libgcc -C link-arg=-Wl,--icf=safe'
export CARGO=cargo-zigbuild

git clone https://github.com/cargo-bins/cargo-binstall
cd cargo-binstall
git checkout d5549ce

cargo-auditable auditable build  --release --target x86_64-unknown-linux-musl --features git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto,git-max-perf --timings

@NobodyXu
Copy link
Contributor Author

NobodyXu commented Aug 2, 2023

The git repository is created using:

GIT="$(mktemp -d 2>/dev/null || mktemp -d -t 'git')"
if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; then
    # Convert it to windows path so `--git "file://$GIT"` would work
    # on windows.
    GIT="$(cygpath -w "$GIT")"
fi

git init "$GIT"
cp manifests/github-test-Cargo.toml "$GIT/Cargo.toml"
(
  cd "$GIT"
  git config user.email '[email protected]'
  git config user.name 'test'
  git add Cargo.toml
  git commit -m "Add Cargo.toml"
)

@Byron
Copy link
Member

Byron commented Aug 3, 2023

As there was no response from people more knowledgable than me, I think maybe it's more of an issue by the underlying zlib-ng C library, and would wonder how to best bring it up there or…make it reproducible.

I also wonder if zlib-ng may have something to do with the spurious gitoxide failures that I have been seeing recently - sometimes they say things like "double-free". …But not to digress, I don't know what the best way would be to bring it up there, maybe a discussion would help gain some insights.

@Byron Byron added help wanted question There is a question to be answered labels Aug 3, 2023
@joshtriplett joshtriplett changed the title libz-ng: Illegle instruction on x86_64-unkown-linux-{musl, gnu} libz-ng: illegal instruction on x86_64-unkown-linux-{musl, gnu} Aug 11, 2023
@EliahKagan
Copy link
Contributor

In case it's relevant, #200 strongly resembles this, though it looks like a case of zlib-ng/zlib-ng#1705, which this does not seem related to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted question There is a question to be answered
Projects
None yet
Development

No branches or pull requests

3 participants