Comments (13)
Hmm, I can reproduce on my system too. gdb doesn't show anything useful:
$ gdb ./difft
Reading symbols from ./difft...
(No debugging symbols found in ./difft)
(gdb) run --version
Starting program: /tmp/difft --version
Program received signal SIGSEGV, Segmentation fault.
0x00000000000a56a6 in ?? ()
(gdb) bt
#0 0x00000000000a56a6 in ?? ()
#1 0x00007ffff43845a5 in ?? ()
#2 0x00007ffff3e69fbb in ?? ()
#3 0x00007ffff3e6ba30 in ?? ()
#4 0x00007ffff4573061 in ?? ()
#5 0x00007ffff3f3c390 in ?? ()
#6 0x00007ffff4573086 in ?? ()
#7 0x00007ffff4573069 in ?? ()
#8 0x0000000000000000 in ?? ()
although that 0x0 in #8
does look suspicious.
from difftastic.
Possibly related: rust-lang/rust#95926
Maybe musl builds should use rust 1.61 to avoid that issue.
from difftastic.
rust-lang/rust#74757 also shows a very similar backtrace.
from difftastic.
What's really bizarre here is that the musl builds are dynamically linked. This is wrong, and differs from the rust default (musl targets are statically linked).
$ ldd difft
linux-vdso.so.1 (0x00007fff1a376000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f6283400000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f6287ae0000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f6283000000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f6287c01000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f6287abb000)
This is slightly different from the normal linux-gnu target, which also has libpthread and libdl, but the musl build is definitely dynamically linked for some reason.
from difftastic.
This is slightly different from the normal linux-gnu target, which also has libpthread and libdl, but the musl build is definitely dynamically linked for some reason.
For what it's worth: I built Clyde, which is Rust-based and provides a musl static binary for Linux. To make it statically linked I had to add this to the build script:
export RUSTFLAGS='-C target-feature=+crt-static'
from difftastic.
Thanks, I'll try that. I don't understand why I'm not getting static linking, rust should statically link musl builds by default I believe:
$ cargo new demo
Created binary (application) `demo` package
$ cd demo
$ cargo build --release --target x86_64-unknown-linux-musl
Compiling demo v0.1.0 (/tmp/demo)
Finished release [optimized] target(s) in 0.32s
$ ldd target/x86_64-unknown-linux-musl/release/demo
statically linked
from difftastic.
That's odd indeed. Maybe the behavior is different in your example because the demo project does not have any dependency?
from difftastic.
$ cross build --release --target x86_64-unknown-linux-musl
$ ldd target/x86_64-unknown-linux-musl/release/difft
statically linked
$ ./target/x86_64-unknown-linux-musl/release/difft --version
Difftastic 0.52.0 (6805939c6 2023-09-28)
I can't replicate this with cross
locally. I'm inclined to blame the upload-rust-binary action. It might also be easier to do more work in shell scripts in this repo, as it's much easier to reproduce issues than re-running GiHub actions over and over.
from difftastic.
I'm wondering if something is picking up an old version of cross. cross-rs/cross#902 looks relevant.
from difftastic.
Probably worth filing an issue on upload-rust-binary-action to see if I've missed anything.
from difftastic.
This is slightly different from the normal linux-gnu target, which also has libpthread and libdl, but the musl build is definitely dynamically linked for some reason.
that's actually not correct anymore. glibc 2.34 removed dynamic libdl.so and libpthread.so, so for new binaries you don't see them anymore- there is only a stub empty .a
. see https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread for some details
what that means is, that ldd
list means the binary has all the libs you would expect for a -crt-static
(dynamic) *-linux-gnu
(glibc) triplet build. i.e. it's not linked to musl at all (or probably it somehow ends up creating a frankenstein binary that on the surface looks like it links glibc; like having all the glibc libs in NEEDED but actually the musl static binary startup code). perhaps something went wrong with the configured rustup toolchain in your case? i haven't seen this specific failure case before, so it's probably related to some default target or the cross setup.
from difftastic.
ah, yeah that cross
issue above looks very related
from difftastic.
Reproduces on CI now, fortunately: https://github.com/Wilfred/difftastic/actions/runs/6986277695/job/19011557098 (after 6051f05).
from difftastic.
Related Issues (20)
- Provide automatic display options that consider terminal width, etc.
- Error: "index out of bounds: the len is 20 but the index is 20" HOT 4
- Unchanged HTML reported as changed HOT 1
- No option to diff hidden files in directories HOT 1
- Word differ returns out-of-bounds column numbers HOT 1
- tree-sitter-lua is out-dated
- index out of bounds: the len is X but the index is X', src/display/inline.rs:115:21
- Bad error recovery from (incorrect) C preprocessor error
- Inline diff is ignoring unchanged lines between hunks
- "index out of bounds" error, panic in side_by_side.rs HOT 2
- Crash inside eshell with memory allocation error HOT 5
- Output file paths as relative to current working directory
- Feature Request: Compare Subdirectories, ignore directory name difference
- Elm diff shows no syntactic changes for changes to doc comments
- `--language` command line argument is not supported
- difft does shows single/double quote as a diff for python HOT 3
- Include line number in patch diff header
- difftastic do not show color in fzf preview
- Dynamic sublanguages (injections)
- [Question] Want to know the changes in the AST nodes of the old and new files? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from difftastic.