Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#77373 - [cargo-c] Segmentation fault on fresh package install

Attached to Project: Community Packages
Opened by quietvoid (quietvoid) - Friday, 03 February 2023, 21:13 GMT
Last edited by Daniel Bermond (Bermond) - Saturday, 04 February 2023, 17:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Daniel Bermond (Bermond)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I'm getting a segmentation fault when running `cargo cbuild` in a project (for example, `rav1e`).

This only happens on a fresh setup, for some reason.
If I do `cargo install cargo-c` instead, the binary works fine.
And then the Arch package also seemingly starts working.

A backtrace points to something with libcrypto but I can't really enable debug symbols and still reproduce the problem.

Additional info:
* package version(s): 0.9.16-1
* link to upstream bug report, if any: This weirdly coincides with the Rustup 1.25.2 update: https://blog.rust-lang.org/2023/02/01/Rustup-1.25.2.html
However installing the latest Rustup version doesn't fix the existing cargo-c package.

Steps to reproduce:
1. Setup Docker image using "archlinux:base-devel" image
2. Install rustup and cargo-c with `pacman -S rustup cargo-c`
3. Install Rust toolchain, `rustup update stable`
4. Clone rav1e repo (https://github.com/xiph/rav1e), cd into it
5. Run `cargo cbuild`
6. It segfaults

Example Dockerfile:
```
FROM archlinux:base-devel

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm git curl openssl rustup cargo-c
```
This task depends upon

Closed by  Daniel Bermond (Bermond)
Saturday, 04 February 2023, 17:51 GMT
Reason for closing:  Fixed
Additional comments about closing:  cargo-c 0.9.16-2
Comment by quietvoid (quietvoid) - Friday, 03 February 2023, 21:44 GMT
I managed to build the related packages for debug, here's the backtrace: https://0x0.st/oC1k.txt
Smaller bt with cargo-c debug symbols: https://0x0.st/oC1n.txt

Still the built package with makepkg fails, while cargo install doesn't.
I have a suspicion it might be caused by enabling --all-features, which could be enabling the vendored OpenSSL from Cargo and causing the problem?

I tried removing --all-features from the build and it works.
Made https://github.com/lu-zero/cargo-c/issues/309 for now.
Comment by quietvoid (quietvoid) - Saturday, 04 February 2023, 16:58 GMT
Follow up on upstream issue: https://github.com/rust-lang/cargo/issues/11681
The Arch package should probably not be using the vendored-openssl feature, so cargo-c should not be built with --all-features.
Comment by Daniel Bermond (Bermond) - Saturday, 04 February 2023, 17:51 GMT
@quietvoid The package was updated and should be fixed now, so fell free to request a reopen if don't. The Arch Wiki rust package guidelines recommends to use the '--all-features' option, so probably the Wiki article should be updated to better explain that not always this should be used, like here as the upstream recommendation. Thank you for reporting this.

Loading...