Git Product home page Git Product logo

btfdump's People

Contributors

anakryiko avatar d-e-s-o avatar dependabot[bot] avatar tamird avatar yan-ace62 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

btfdump's Issues

thread 'main' panicked at 'index out of bounds

cloudcome.net>/home/cloudcome/btfdump/target/debug/btf dump --format c test.o

thread 'main' panicked at 'index out of bounds: the len is 23 but the index is 23', src/types.rs:1538:46
stack backtrace:
   0:     0x55fd871dddcd - std::backtrace_rs::backtrace::libunwind::trace::h8217d0a8f3fd2f41
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55fd871dddcd - std::backtrace_rs::backtrace::trace_unsynchronized::h308103876b3af410
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55fd871dddcd - std::sys_common::backtrace::_print_fmt::hc208018c6153605e
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x55fd871dddcd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf89a7ed694dfb585
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x55fd871f9f9c - core::fmt::write::h21038c1382fe4264
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17
   5:     0x55fd871dba61 - std::io::Write::write_fmt::h7dbb1c9a3c254aef
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15
   6:     0x55fd871df455 - std::sys_common::backtrace::_print::h4e8889719c9ddeb8
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x55fd871df455 - std::sys_common::backtrace::print::h1506fe2cb3022667
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x55fd871df455 - std::panicking::default_hook::{{closure}}::hd9d7ce2a8a782440
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22
   9:     0x55fd871df176 - std::panicking::default_hook::h5b16ec25444b1b5d
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9
  10:     0x55fd871df9e6 - std::panicking::rust_panic_with_hook::hb0138cb6e6fea3e4
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:698:17
  11:     0x55fd871df8d7 - std::panicking::begin_panic_handler::{{closure}}::h4cb67095557cd1aa
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:588:13
  12:     0x55fd871de284 - std::sys_common::backtrace::__rust_end_short_backtrace::h2bfcac279dcdc911
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18
  13:     0x55fd871df609 - rust_begin_unwind
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
  14:     0x55fd86e62de3 - core::panicking::panic_fmt::h1de71520faaa17d3
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
  15:     0x55fd86e62d22 - core::panicking::panic_bounds_check::hfef1f84c4a547e72
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:84:5
  16:     0x55fd86ea6c0d - btf::types::Btf::get_btf_str::h184e6d68284532fd
                               at /home/cloudcome/btfdump/src/types.rs:1538:46
  17:     0x55fd86ea4ad4 - btf::types::Btf::load_func_secs::hdd6266aee770e568
                               at /home/cloudcome/btfdump/src/types.rs:1413:23
  18:     0x55fd86ea05ee - btf::types::Btf::load::h5090202c0eed76fc
                               at /home/cloudcome/btfdump/src/types.rs:1105:33
  19:     0x55fd86e7b7cc - btf::main::h07c6070b1368d324
                               at /home/cloudcome/btfdump/src/main.rs:179:23
  20:     0x55fd86e67a2b - core::ops::function::FnOnce::call_once::habe98135a3ae8639
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:248:5
  21:     0x55fd86e83fce - std::sys_common::backtrace::__rust_begin_short_backtrace::h84e73ff9c9a78c0a
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:122:18
  22:     0x55fd86e842d1 - std::rt::lang_start::{{closure}}::h800a4948425f75cc
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:145:18
  23:     0x55fd871d789e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h4937aaa125c8d4b2
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:280:13
  24:     0x55fd871d789e - std::panicking::try::do_call::h6f5c70e8b0a34f92
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
  25:     0x55fd871d789e - std::panicking::try::h68766ba264ecf2e2
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
  26:     0x55fd871d789e - std::panic::catch_unwind::hc36033d2f9cc04af
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
  27:     0x55fd871d789e - std::rt::lang_start_internal::{{closure}}::h78c037f4a1a28ded
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:48
  28:     0x55fd871d789e - std::panicking::try::do_call::he6e1fffda4c750ee
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
  29:     0x55fd871d789e - std::panicking::try::h48a77ddbb2f4c87a
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
  30:     0x55fd871d789e - std::panic::catch_unwind::hfa809b06a550a9e7
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
  31:     0x55fd871d789e - std::rt::lang_start_internal::h4db69ed48eaca005
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:20
  32:     0x55fd86e842a0 - std::rt::lang_start::h197089584f4bf80f
                               at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:144:17
  33:     0x55fd86e830cc - main
  34:     0x7fa8502c3fd0 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  35:     0x7fa8502c407d - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:409:3
  36:     0x55fd86e63075 - _start
  37:                0x0 - <unknown>

Question: recommended BTF Rust library

Hi,

I'm planning to write a CLI tool that, among other things, needs to parse BTF files.

It seems to me that there isn't an established Rust library for that yet. The others I could find are https://crates.io/crates/btf-rs, https://crates.io/crates/btf.

I was wondering if you would recommend using going with library as a dependency (concerning API stability, support of new BTF extensions, ect.), or if one of the others is more likely to become the "standard solution"? More generally it would be interesting to know if you even aim to become the "standard solution" for parsing BTF in Rust and being depended on by other projects?

Of course I'd be happy to contribute if there is something I need that needs to be implemented.

Consider publishing a new version of `btfdump` on `crates.io`

#3 is fixed, but the changes haven't been published to crates.io.

Crates.io requires that any packages uploaded have to specify packages by version, not by git repo and rev. Since the changes of #4 haven't been published to crates.io, any crates that dependends on btfdump = "0.0.1" will still suffer from the bug.

failed in cargo build

cargo build
error[E0308]: mismatched types
    --> src/types.rs:1538:45
     |
1538 |         let c_str = unsafe { CStr::from_ptr(&strs[off as usize] as *const u8 as *const i8) };
     |                              -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
     |                              |
     |                              arguments to this function are incorrect
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: associated function defined here

Hi, How to solve this problem?

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.