Code Monkey home page Code Monkey logo

rstack's Introduction

rstack's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar eliageretto avatar mikailbag avatar mjkoo avatar sfackler 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rstack's Issues

libunwind-sys fails to compile on macOS

Output of cargo build:

error: failed to run custom build command for `unwind-sys v0.1.3`

Caused by:
  process didn't exit successfully: `/Users/jordydickinson/Documents/Projects/geode/runtime/target/debug/build/unwind-sys-5d5614cc26fe5642/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBUNWIND_GENERIC_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBUNWIND_GENERIC_STATIC
  cargo:rerun-if-env-changed=LIBUNWIND_GENERIC_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_apple_darwin
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_apple_darwin
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /Users/jordydickinson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/unwind-sys-0.1.3/build.rs:11:50:
  called `Result::unwrap()` on an `Err` value: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "libunwind-generic"` did not exit successfully: exit status: 1
  error: could not find system library 'libunwind-generic' required by the 'unwind-sys' crate

  --- stderr
  Package libunwind-generic was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libunwind-generic.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libunwind-generic' found

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

x86_64 `unw_cursor_t` is self-referential but `Cursor` is not pinned

For x86_64, unw_cursor_t is self-referential. This can be observed in the following line:
https://github.com/libunwind/libunwind/blob/v1.5/src/x86_64/Ginit_local.c#L52

Cursor contains an unw_cursor_t, but it is not marked as pinned. As a consequence, the reference in dwarf.as_arg will be invalidated on the first move. For the same reason, it should also not derive Clone, I believe.

I am not sure if this is a bug in libunwind, since they state in the documentation that:

The former would be used as the
current cursor and prev would be maintained as the ``previous frame'' cursor by copying
the contents of curr to prev right before calling unw_step()

This means that cursors are meant to be copiable, but the x86_64 one is obviously not. Still, I thought it was worth reporting.

Fails to build when linking with `lld`

The unwind-sys crate fails to build when using lld as the linker:

RUSTFLAGS='-Clink-args=-fuse-ld=lld' cargo t --all-features produces a linker error:

          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_stream_buffer_decode [--no-allow-shlib-undefined]
          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_index_uncompressed_size [--no-allow-shlib-undefined]
          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_index_end [--no-allow-shlib-undefined]
          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_index_buffer_decode [--no-allow-shlib-undefined]
          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_stream_footer_decode [--no-allow-shlib-undefined]
          ld.lld: error: /usr/lib/x86_64-linux-gnu/libunwind-ptrace.so: undefined reference to lzma_index_size [--no-allow-shlib-undefined]
          collect2: error: ld returned 1 exit status
          
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `unwind-sys` due to previous error

Your crate seems to rely on some GNU ld behaviour that the lld team are unwilling to replicate (llvm/llvm-project#54700).

I suggest this can be fixed by adding a cargo:rustc-link-lib=lzma directive to your build.rs build script.

Preconditions of rstack

Hello!
Could you please clarify, what conditions my application must meet so that rstack will work successfully?

  • As far as I undertood, child must be in paused state. Does ptrace's syscall-enter-stop suffice?
  • Does tracer need root?
  • Maybe, child must be spawned by tracer directly?

I ask this, because I have Operation not permitted (os error 1) error when using your library, and it is quite hard to debug this error, because strace doesn't work on other tracer.

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.