Giter Site home page Giter Site logo

Comments (5)

pacak avatar pacak commented on September 15, 2024

from cargo-show-asm.

betelgeuse avatar betelgeuse commented on September 15, 2024

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.

pacak avatar pacak commented on September 15, 2024

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.

betelgeuse avatar betelgeuse commented on September 15, 2024

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.

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.

pacak avatar pacak commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.