Comments (5)
from cargo-show-asm.
Do you have a reproduction public? Also - what platform/version do you use?
I don't and Linux f1782c895047 6.6.26-linuxkit #1 SMP Sat Apr 27 04:13:19 UTC 2024 aarch64 GNU/Linux
This is from a container from the image 4da2332e8c88 (rustlang/rust:nightly from some time ago)
from cargo-show-asm.
So the fix should be as simple as removing panic, but I would like to understand the problem.
Can you attach the .s
file it tries to process and output of cargo asm -vv
- mostly parts about what it detects? They shouldn't contain anything sensitive, you can use manpacket at gmail if you prefer.
from cargo-show-asm.
So the fix should be as simple as removing panic, but I would like to understand the problem.
Can you attach the
.s
file it tries to process and output ofcargo asm -vv
- mostly parts about what it detects? They shouldn't contain anything sensitive, you can use manpacket at gmail if you prefer.
The .s
file is basically all logic inlined. But here's the current output and the start of the .s
file.
Finished `release` profile [optimized] target(s) in 0.08s
Artifact files: ["/app/target/release/mmap"]
Working with file: /app/target/release/deps/mmap-80e1dd19c4c62c11.s
.text
.file "mmap.d5c79bd6df815694-cgu.0"
.section .text.std::sys::backtrace::__rust_begin_short_backtrace,"ax",@progbits
.p2align 2
.type std::sys::backtrace::__rust_begin_short_backtrace,@function
std::sys::backtrace::__rust_begin_short_backtrace:
thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-show-asm-0.2.36/src/asm.rs:285:21:
DWARF file refers to an undefined location Loc { file: 1, line: 151, column: 0, extra: None }
stack backtrace:
0: 0xaaaacf2e1428 - <std::sys::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdbd0154edd27beae
1: 0xaaaacf301bd0 - core::fmt::write::hd00e4dd0f79a6962
2: 0xaaaacf2de3a0 - std::io::Write::write_fmt::hfe9cba738b97abe4
3: 0xaaaacf2e1270 - std::sys::backtrace::print::h98cdc673933b7a70
4: 0xaaaacf2e2780 - std::panicking::default_hook::{{closure}}::h2fd387741efa82f6
5: 0xaaaacf2e23e8 - std::panicking::default_hook::hae15ef2aca4ca978
6: 0xaaaacf2e2cb4 - std::panicking::rust_panic_with_hook::h0fab909538e02d6f
7: 0xaaaacf2e2abc - std::panicking::begin_panic_handler::{{closure}}::hce66eb404d13d1f8
8: 0xaaaacf2e1910 - std::sys::backtrace::__rust_end_short_backtrace::ha5ea7c255d0d41a0
9: 0xaaaacf2e27d0 - rust_begin_unwind
10: 0xaaaacf15722c - core::panicking::panic_fmt::h79524b56a5fcb226
11: 0xaaaacf188fd4 - <cargo_show_asm::asm::Asm as cargo_show_asm::Dumpable>::dump_range::h31821f4de5e275a3
12: 0xaaaacf17286c - cargo_show_asm::dump_function::h4ff065852407b087
13: 0xaaaacf16cf7c - cargo_asm::main::hbec0d681464995a0
14: 0xaaaacf184c20 - std::sys::backtrace::__rust_begin_short_backtrace::h7ea072e629dbbbdc
15: 0xaaaacf17f3b8 - std::rt::lang_start::{{closure}}::he9b4f38ea1b05712
16: 0xaaaacf2d86ec - std::rt::lang_start_internal::h457550829114b953
17: 0xaaaacf16e9e8 - main
18: 0xffff8fc97780 - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
19: 0xffff8fc97858 - __libc_start_main_impl
at ./csu/../csu/libc-start.c:360:3
20: 0xaaaacf157870 - _start
21: 0x0 - <unknown>
head -n 20 target/release/deps/mmap-80e1dd19c4c62c11.s
.text
.file "mmap.d5c79bd6df815694-cgu.0"
.section .text._ZN3std3sys9backtrace28__rust_begin_short_backtrace17h065b82dfadfc7072E,"ax",@progbits
.p2align 2
.type _ZN3std3sys9backtrace28__rust_begin_short_backtrace17h065b82dfadfc7072E,@function
_ZN3std3sys9backtrace28__rust_begin_short_backtrace17h065b82dfadfc7072E:
.Lfunc_begin0:
.file 1 "/rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/library/std/src/sys" "backtrace.rs"
.loc 1 151 0
.cfi_startproc
str x30, [sp, #-16]!
.cfi_def_cfa_offset 16
.cfi_offset w30, -16
.Ltmp1358:
.file 2 "/rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/library/core/src/ops" "function.rs"
.loc 2 250 5 prologue_end
blr x0
.Ltmp1359:
.file 3 "/rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/library/core/src" "hint.rs"
.loc 3 338 5
The line does seem to be present in backtrace.rs
# tail -n+150 /rustc/6b0f4b5ec3aa707ecaa78230722117324a4ce23c/library/std/src/sys/backtrace.rs | head -n 10
#[cfg_attr(feature = "backtrace", inline(never))]
pub fn __rust_begin_short_backtrace<F, T>(f: F) -> T
where
F: FnOnce() -> T,
{
let result = f();
// prevent this frame from being tail-call optimised away
crate::hint::black_box(());
from cargo-show-asm.
Thank you for the bug report, I was able to reproduce and the fix was trivial after that. 0.2.37 is out.
from cargo-show-asm.
Related Issues (20)
- `sample` test case is broken with 1.75 HOT 12
- Add use a separate library to implement syntax highlight for llvm/mir/asm
- Wrong path used for rustc sources HOT 10
- Automate release process
- --rust flag shows code from libstd HOT 4
- Function selection via index broken on v0.2.24 to v0.2.28 HOT 6
- Option to include called functions (to some depth) HOT 6
- Install fails with rustc 1.74.0 HOT 3
- [Bugfix]: release-plz workflow - ERROR failed to update packages HOT 3
- color output can be very difficult to read on dark backgrounds HOT 1
- `--simplify` removes inline assembly HOT 5
- Debug info included by default in 0.2.33 HOT 1
- Missing/incorrect line information HOT 6
- An easier way to compare different versions
- Missed no_mangle symbol in no_std/no_main Windows code HOT 10
- On 32bit Windows no_mangle names needs stripping
- Support `rustc_codegen_cranelift` HOT 2
- `cargo-asm` panics with `No cdylib?` when called in a `["lib", "cdylib"]` wasm project HOT 2
- Does not work on default new library HOT 2
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 cargo-show-asm.