Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64 support? #4

Open
tiann opened this issue Jul 30, 2022 · 13 comments
Open

arm64 support? #4

tiann opened this issue Jul 30, 2022 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@tiann
Copy link

tiann commented Jul 30, 2022

No description provided.

@JakWai01 JakWai01 added the enhancement New feature or request label Aug 1, 2022
@tiann
Copy link
Author

tiann commented Aug 5, 2022

I try to build it on arm64 and here is the error:

❯ cargo build --target aarch64-unknown-linux-gnu
   Compiling lurk v0.1.0 (/Users/weishu/dev/github/lurk)
error[E0425]: cannot find function `getregs` in module `ptrace`
   --> src/main.rs:170:23
    |
170 |         match ptrace::getregs(child) {
    |                       ^^^^^^^ not found in `ptrace`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `lurk` due to previous error

nix crate doesn't support ptrace.getregs on arm64 now, the related issue: nix-rust/nix#1419

@2096779623
Copy link

Compiling lurk-cli v0.2.9 (/project)
error[E0432]: unresolved import `linux_personality::personality`
Error:   --> src/main.rs:12:5
   |
12 | use linux_personality::personality;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `personality` in the root

error[E0425]: cannot find function `getregs` in module `ptrace`
Error:    --> src/main.rs:165:23
    |
165 |         match ptrace::getregs(child) {
    |                       ^^^^^^^ not found in `ptrace`

error[E0425]: cannot find value `ADDR_NO_RANDOMIZE` in crate `linux_personality`
Error:    --> src/main.rs:608:36
    |
608 |     personality(linux_personality::ADDR_NO_RANDOMIZE).unwrap();
    |                                    ^^^^^^^^^^^^^^^^^ not found in `linux_personality`
    |
help: consider importing this constant
    |
5   | use libc::ADDR_NO_RANDOMIZE;
    |
help: if you import `ADDR_NO_RANDOMIZE`, refer to it directly
    |
608 -     personality(linux_personality::ADDR_NO_RANDOMIZE).unwrap();
608 +     personality(ADDR_NO_RANDOMIZE).unwrap();
    |

error[E0308]: mismatched types
Error:     --> src/main.rs:657:41
     |
657  |         bytes.write_i64::<LittleEndian>(res).unwrap_or_else(|err| {
     |               ------------------------- ^^^ expected `i64`, found `i32`
     |               |
     |               arguments to this function are incorrect
     |
note: associated function defined here
    --> /cargo/registry/src/github.com-1ecc6[299](https://github.com/2096779623/lurk/actions/runs/3398907517/jobs/5652300328#step:4:301)db9ec823/byteorder-1.4.3/src/io.rs:1394:8
     |
1394 |     fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> {
     |        ^^^^^^^^^
help: you can convert an `i32` to an `i64`
     |
657  |         bytes.write_i64::<LittleEndian>(res.into()).unwrap_or_else(|err| {
     |                                            +++++++

Some errors have detailed explanations: E0308, E0425, E0432.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `lurk-cli` due to 4 previous errors

@JakWai01
Copy link
Owner

JakWai01 commented Jan 6, 2023

Thanks for opening this issue. Supporting multiple architectures is something I tried to avoid as long as possible since I need to manually create a syscall-table for every single architecture. Additionally, some libraries might not be supported on every architecture/operating system. Implementing this probably requires rewriting a larger portion of my code to allow for a more generic implementation. I will try to tackle this problem as soon as possible.

@JakWai01 JakWai01 self-assigned this Jan 6, 2023
@Integralist
Copy link

Ah! OK so this is a known issue 👍🏻

As yeah I just tried installing on an M1 macOS...

Darwin D3496LK9V7 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64

...and was getting this compilation error...

cargo install lurk-cli
    Updating crates.io index
  Downloaded lurk-cli v0.2.9
  Downloaded 1 crate (142.9 KB) in 1.54s
  Installing lurk-cli v0.2.9
  Downloaded once_cell v1.17.1
  Downloaded itoa v1.0.6
  Downloaded ryu v1.0.13
  Downloaded unicode-ident v1.0.8
  Downloaded serde_json v1.0.94
  Downloaded syn v1.0.109
  Downloaded num-complex v0.1.43
  Downloaded users v0.11.0
  Downloaded nix v0.24.3
  Downloaded num v0.1.42
  Downloaded bitflags v0.7.0
  Downloaded rustc-serialize v0.3.24
  Downloaded num-rational v0.1.42
  Downloaded num-bigint v0.1.44
  Downloaded stopwatch v0.0.7
  Downloaded linux-personality v1.0.0
  Downloaded 16 crates (972.7 KB) in 1.11s
   Compiling autocfg v1.1.0
   Compiling libc v0.2.139
   Compiling proc-macro2 v1.0.51
   Compiling version_check v0.9.4
   Compiling quote v1.0.23
   Compiling unicode-ident v1.0.8
   Compiling syn v1.0.109
   Compiling rustc-serialize v0.3.24
   Compiling memchr v2.5.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling num-traits v0.2.15
   Compiling num-integer v0.1.45
   Compiling num-iter v0.1.43
   Compiling proc-macro-error v1.0.4
   Compiling memoffset v0.6.5
   Compiling indexmap v1.9.2
   Compiling cfg-if v1.0.0
   Compiling log v0.4.17
   Compiling serde v1.0.152
   Compiling rand v0.4.6
   Compiling num-bigint v0.1.44
   Compiling num-complex v0.1.43
   Compiling num-rational v0.1.42
   Compiling bitflags v1.3.2
   Compiling os_str_bytes v6.4.1
   Compiling hashbrown v0.12.3
   Compiling serde_json v1.0.94
   Compiling heck v0.4.1
   Compiling anyhow v1.0.69
   Compiling clap_lex v0.2.4
   Compiling num v0.1.42
   Compiling aho-corasick v0.7.20
   Compiling atty v0.2.14
   Compiling once_cell v1.17.1
   Compiling strsim v0.10.0
   Compiling bitflags v0.7.0
   Compiling itoa v1.0.6
   Compiling regex-syntax v0.6.28
   Compiling termcolor v1.2.0
   Compiling clap_derive v3.2.18
   Compiling textwrap v0.16.0
   Compiling ryu v1.0.13
   Compiling linux-personality v1.0.0
   Compiling users v0.11.0
   Compiling nix v0.24.3
   Compiling stopwatch v0.0.7
   Compiling byteorder v1.4.3
   Compiling ansi_term v0.12.1
   Compiling regex v1.7.1
   Compiling clap v3.2.23
   Compiling lurk-cli v0.2.9
error[E0432]: unresolved import `linux_personality::personality`
  --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:12:5
   |
12 | use linux_personality::personality;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `personality` in the root

error[E0433]: failed to resolve: use of undeclared type `Options`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:154:21
    |
154 |                     Options::PTRACE_O_TRACEFORK
    |                     ^^^^^^^ use of undeclared type `Options`

error[E0433]: failed to resolve: use of undeclared type `Options`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:155:27
    |
155 |                         | Options::PTRACE_O_TRACEVFORK
    |                           ^^^^^^^ use of undeclared type `Options`

error[E0433]: failed to resolve: use of undeclared type `Options`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:156:27
    |
156 |                         | Options::PTRACE_O_TRACECLONE,
    |                           ^^^^^^^ use of undeclared type `Options`

error[E0425]: cannot find function `setoptions` in module `ptrace`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:152:25
    |
152 |                 ptrace::setoptions(
    |                         ^^^^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `getregs` in module `ptrace`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:165:23
    |
165 |         match ptrace::getregs(child) {
    |                       ^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `syscall` in module `ptrace`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:521:23
    |
521 |         match ptrace::syscall(child, None) {
    |                       ^^^^^^^ not found in `ptrace`
    |
help: consider importing this function
    |
5   | use libc::syscall;
    |
help: if you import `syscall`, refer to it directly
    |
521 -         match ptrace::syscall(child, None) {
521 +         match syscall(child, None) {
    |

error[E0425]: cannot find value `ADDR_NO_RANDOMIZE` in crate `linux_personality`
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:607:36
    |
607 |     personality(linux_personality::ADDR_NO_RANDOMIZE).unwrap();
    |                                    ^^^^^^^^^^^^^^^^^ not found in `linux_personality`

error[E0308]: mismatched types
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:251:69
    |
251 | ...                   let mut string = read_string(child, reg as *mut c_void);
    |                                        -----------        ^^^^^^^^^^^^^^^^^^ expected `i8`, found enum `c_void`
    |                                        |
    |                                        arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut i8`
               found raw pointer `*mut c_void`
note: function defined here
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:639:4
    |
639 | fn read_string(pid: Pid, address: AddressType) -> String {
    |    ^^^^^^^^^^^           --------------------

error[E0308]: mismatched types
   --> /Users/integralist/.cargo/registry/src/github.com-1ecc6299db9ec823/lurk-cli-0.2.9/src/main.rs:652:33
    |
649 |         let res: c_long;
    |                  ------ expected due to this type
...
652 |             Ok(c_long) => res = c_long,
    |                                 ^^^^^^ expected `i64`, found `i32`

Some errors have detailed explanations: E0308, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `lurk-cli` due to 10 previous errors
error: failed to compile `lurk-cli v0.2.9`, intermediate artifacts can be found at `/var/folders/lj/y1tlk7nd5tgcz5z00fycytjr0000gp/T/cargo-installIBk2Nn`

@chenrui333
Copy link

This is my m1 build with the 0.3.3 release

   Compiling lurk-cli v0.3.2 (/private/tmp/lurk-20230611-91173-1efmnow/lurk-0.3.3)
error[E0432]: unresolved import `libc::user_regs_struct`
 --> src/arch/mod.rs:3:33
  |
3 | use libc::{c_long, c_ulonglong, user_regs_struct};
  |                                 ^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root

error[E0432]: unresolved import `nix::sys::ptrace::Options`
 --> src/arch/mod.rs:5:5
  |
5 | use nix::sys::ptrace::Options;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^ no `Options` in `sys::ptrace`

error[E0432]: unresolved import `libc::user_regs_struct`
 --> src/syscall_info.rs:4:25
  |
4 | use libc::{c_ulonglong, user_regs_struct};
  |                         ^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root

error[E0432]: unresolved imports `linux_personality::personality`, `linux_personality::ADDR_NO_RANDOMIZE`
  --> src/lib.rs:23:25
   |
23 | use linux_personality::{personality, ADDR_NO_RANDOMIZE};
   |                         ^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^ no `ADDR_NO_RANDOMIZE` in the root
   |                         |
   |                         no `personality` in the root
   |
   = help: consider importing one of these items instead:
           crate::Sysno::personality
           syscalls::Sysno::personality
           syscalls::arm::Sysno::personality
           syscalls::mips64::Sysno::personality
           syscalls::mips::Sysno::personality
           syscalls::powerpc64::Sysno::personality
           syscalls::powerpc::Sysno::personality
           syscalls::s390x::Sysno::personality
           syscalls::sparc64::Sysno::personality
           syscalls::sparc::Sysno::personality
           syscalls::x86::Sysno::personality
           syscalls::x86_64::Sysno::personality

error[E0432]: unresolved imports `crate::arch::TRACE_CLOCK`, `crate::arch::TRACE_CREDS`, `crate::arch::TRACE_DESC`, `crate::arch::TRACE_FILE`, `crate::arch::TRACE_FSTAT`, `crate::arch::TRACE_FSTATFS`, `crate::arch::TRACE_IPC`, `crate::arch::TRACE_LSTAT`, `crate::arch::TRACE_MEMORY`, `crate::arch::TRACE_NETWORK`, `crate::arch::TRACE_PROCESS`, `crate::arch::TRACE_PURE`, `crate::arch::TRACE_SIGNAL`, `crate::arch::TRACE_STAT`, `crate::arch::TRACE_STATFS`, `crate::arch::TRACE_STATFS_LIKE`, `crate::arch::TRACE_STAT_LIKE`
 --> src/args.rs:2:5
  |
2 |     TRACE_CLOCK, TRACE_CREDS, TRACE_DESC, TRACE_FILE, TRACE_FSTAT, TRACE_FSTATFS, TRACE_IPC,
  |     ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^ no `TRACE_IPC` in `arch`
  |     |            |            |           |           |            |
  |     |            |            |           |           |            no `TRACE_FSTATFS` in `arch`
  |     |            |            |           |           no `TRACE_FSTAT` in `arch`
  |     |            |            |           no `TRACE_FILE` in `arch`
  |     |            |            no `TRACE_DESC` in `arch`
  |     |            no `TRACE_CREDS` in `arch`
  |     no `TRACE_CLOCK` in `arch`
3 |     TRACE_LSTAT, TRACE_MEMORY, TRACE_NETWORK, TRACE_PROCESS, TRACE_PURE, TRACE_SIGNAL, TRACE_STAT,
  |     ^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^
  |     |            |             |
  |     |            |             no `TRACE_NETWORK` in `arch`
  |     |            no `TRACE_MEMORY` in `arch`
  |     no `TRACE_LSTAT` in `arch`
4 |     TRACE_STATFS, TRACE_STATFS_LIKE, TRACE_STAT_LIKE,
  |     ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^

error[E0425]: cannot find function `setoptions` in module `ptrace`
  --> src/arch/mod.rs:98:13
   |
98 |     ptrace::setoptions(
   |             ^^^^^^^^^^ not found in `ptrace`

error[E0425]: cannot find value `SYSCALLS` in this scope
   --> src/arch/mod.rs:107:9
    |
107 |         SYSCALLS[syscall.id() as usize]
    |         ^^^^^^^^ not found in this scope

error[E0425]: cannot find function `getregs` in module `ptrace`
   --> src/lib.rs:106:41
    |
106 |             let Ok(registers) = ptrace::getregs(self.pid) else {
    |                                         ^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `syscall` in module `ptrace`
   --> src/lib.rs:168:24
    |
168 |             if ptrace::syscall(self.pid, None).is_err() {
    |                        ^^^^^^^ not found in `ptrace`
    |
help: consider importing one of these items
    |
18  | use libc::syscall;
    |
18  | use syscalls::mips::Sysno::syscall;
    |
18  | use syscalls::syscall;
    |
help: if you import `syscall`, refer to it directly
    |
168 -             if ptrace::syscall(self.pid, None).is_err() {
168 +             if syscall(self.pid, None).is_err() {
    |

error[E0308]: mismatched types
   --> src/arch/mod.rs:75:51
    |
75  |         let res: c_long = match ptrace::read(pid, address) {
    |                                 ------------      ^^^^^^^ expected `*mut i8`, found `*mut c_void`
    |                                 |
    |                                 arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut i8`
               found raw pointer `*mut c_void`
note: function defined here
   --> /Users/rui/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/nix-0.26.2/src/sys/ptrace/bsd.rs:181:8
    |
181 | pub fn read(pid: Pid, addr: AddressType) -> Result<c_int> {
    |        ^^^^

error[E0308]: mismatched types
  --> src/arch/mod.rs:76:27
   |
76 |             Ok(c_long) => c_long,
   |                           ^^^^^^ expected `i64`, found `i32`
   |
help: you can convert an `i32` to an `i64`
   |
76 |             Ok(c_long) => c_long.into(),
   |                                 +++++++

error[E0425]: cannot find function `get_arg_value` in this scope
   --> src/arch/mod.rs:112:37
    |
112 |             .map(|(idx, arg)| (arg, get_arg_value(registers, idx)))
    |                                     ^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0308, E0425, E0432.

@JakWai01
Copy link
Owner

Thanks for posting your trace! So far, lurk does not support ARM. Supporting it requires updating the syscall tables with the corresponding system calls as well as replacing the libraries that do not exist for your system. It may take some time, but I'll try to tackle this at some point! 😄

@chenrui333
Copy link

@JakWai01 also I have having issue compiling it in macos x86 as well, is that expected?

@orhun
Copy link
Collaborator

orhun commented Sep 11, 2024

I hit a similar issue on a rust:1.81.0-alpine3.20 Docker image:

#13 64.63 error[E0432]: unresolved import `libc::PTRACE_SYSCALL_INFO_EXIT`
#13 64.63   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.6/src/lib.rs:77:30
#13 64.63    |
#13 64.63 77 | use libc::{user_regs_struct, PTRACE_SYSCALL_INFO_EXIT};
#13 64.63    |                              ^^^^^^^^^^^^^^^^^^^^^^^^ no `PTRACE_SYSCALL_INFO_EXIT` in the root
#13 64.63
#13 64.64    Compiling tui-big-text v0.6.0
#13 64.71    Compiling heh v0.6.1
#13 64.88    Compiling textwrap v0.16.1
#13 65.28 For more information about this error, try `rustc --explain E0432`.
#13 65.34 error: could not compile `lurk-cli` (lib) due to 1 previous error
#13 65.34 warning: build failed, waiting for other jobs to finish...

@omnivagant
Copy link

@orhun , I can reproduce by building lurk v0.3.6 on alpine linux, as you did, but since the latest commit to the main branch your issue seems to be resolved, perhaps we could have a v0.3.7 release of the crate?

@UncleGravity
Copy link

When I run cargo install --git https://github.com/JakWai01/lurk on apple silicon mac, I get this error:

 Updating git repository `https://github.com/JakWai01/lurk`
  Installing lurk-cli v0.3.6 (https://github.com/JakWai01/lurk#f28e066d)
    Updating crates.io index
     Locking 74 packages to latest compatible versions
      Adding bitflags v0.7.0 (latest: v2.6.0)
      Adding crossterm v0.27.0 (latest: v0.28.1)
      Adding encode_unicode v0.3.6 (latest: v1.0.0)
      Adding hermit-abi v0.1.19 (latest: v0.4.0)
      Adding windows-sys v0.52.0 (latest: v0.59.0)
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.13
   Compiling libc v0.2.158
   Compiling autocfg v1.3.0
   Compiling cfg-if v1.0.0
   Compiling parking_lot_core v0.9.10
   Compiling rustversion v1.0.17
   Compiling scopeguard v1.2.0
   Compiling utf8parse v0.2.2
   Compiling memchr v2.7.4
   Compiling serde v1.0.210
   Compiling heck v0.5.0
   Compiling smallvec v1.13.2
   Compiling anstyle-parse v0.2.5
   Compiling is_terminal_polyfill v1.70.1
   Compiling anstyle v1.0.8
   Compiling colorchoice v1.0.2
   Compiling bitflags v2.6.0
   Compiling cfg_aliases v0.2.1
   Compiling anstyle-query v1.1.1
   Compiling unicode-width v0.1.13
   Compiling lock_api v0.4.12
   Compiling nix v0.29.0
   Compiling aho-corasick v1.1.3
   Compiling anstream v0.6.15
   Compiling strsim v0.11.1
   Compiling syscalls v0.6.18
   Compiling anyhow v1.0.88
   Compiling serde_json v1.0.128
   Compiling regex-syntax v0.8.4
   Compiling clap_lex v0.7.2
   Compiling clap_builder v4.5.17
   Compiling regex-automata v0.4.7
   Compiling lazy_static v1.5.0
   Compiling itoa v1.0.11
   Compiling ryu v1.0.18
   Compiling bitflags v0.7.0
   Compiling log v0.4.22
   Compiling strum v0.26.3
   Compiling byteorder v1.5.0
   Compiling quote v1.0.37
   Compiling syn v2.0.77
   Compiling linux-personality v1.0.0
   Compiling users v0.11.0
   Compiling console v0.15.8
   Compiling parking_lot v0.12.3
   Compiling atty v0.2.14
   Compiling regex v1.10.6
   Compiling crossterm v0.27.0
   Compiling serde_derive v1.0.210
   Compiling clap_derive v4.5.13
   Compiling strum_macros v0.26.4
   Compiling serde_repr v0.1.19
   Compiling clap v4.5.17
   Compiling comfy-table v7.1.1
   Compiling lurk-cli v0.3.6 (/Users/useradmin/.cargo/git/checkouts/lurk-5c9424712b626610/f28e066)
error[E0432]: unresolved import `libc::user_regs_struct`
 --> src/arch/mod.rs:3:33
  |
3 | use libc::{c_long, c_ulonglong, user_regs_struct};
  |                                 ^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root

error[E0432]: unresolved import `nix::sys::ptrace::Options`
 --> src/arch/mod.rs:5:5
  |
5 | use nix::sys::ptrace::Options;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^ no `Options` in `sys::ptrace`

error[E0432]: unresolved import `libc::user_regs_struct`
 --> src/arch/aarch64.rs:2:25
  |
2 | use libc::{c_ulonglong, user_regs_struct};
  |                         ^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root
  |
  = help: consider importing this unresolved item through its public re-export instead:
          crate::arch::user_regs_struct

error[E0432]: unresolved import `libc::user_regs_struct`
 --> src/syscall_info.rs:3:25
  |
3 | use libc::{c_ulonglong, user_regs_struct};
  |                         ^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root

error[E0432]: unresolved import `libc::user_regs_struct`
  --> src/lib.rs:77:5
   |
77 | use libc::user_regs_struct;
   |     ^^^^^^^^^^^^^^^^^^^^^^ no `user_regs_struct` in the root

error[E0432]: unresolved imports `linux_personality::personality`, `linux_personality::ADDR_NO_RANDOMIZE`
  --> src/lib.rs:78:25
   |
78 | use linux_personality::{personality, ADDR_NO_RANDOMIZE};
   |                         ^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^ no `ADDR_NO_RANDOMIZE` in the root
   |                         |
   |                         no `personality` in the root
   |
   = help: consider importing one of these items instead:
           crate::Sysno::personality
           syscalls::Sysno::personality
           syscalls::arm::Sysno::personality
           syscalls::mips64::Sysno::personality
           syscalls::mips::Sysno::personality
           syscalls::powerpc64::Sysno::personality
           syscalls::powerpc::Sysno::personality
           syscalls::riscv32::Sysno::personality
           syscalls::riscv64::Sysno::personality
           syscalls::s390x::Sysno::personality
           syscalls::sparc64::Sysno::personality
           syscalls::sparc::Sysno::personality
           syscalls::x86::Sysno::personality
           syscalls::x86_64::Sysno::personality

error[E0432]: unresolved import `nix::sys::ptrace::Event`
  --> src/lib.rs:79:30
   |
79 | use nix::sys::ptrace::{self, Event};
   |                              ^^^^^ no `Event` in `sys::ptrace`

error[E0425]: cannot find function `setoptions` in module `ptrace`
   --> src/arch/mod.rs:102:13
    |
102 |     ptrace::setoptions(
    |             ^^^^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `setoptions` in module `ptrace`
   --> src/arch/mod.rs:109:13
    |
109 |     ptrace::setoptions(
    |             ^^^^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `getevent` in module `ptrace`
   --> src/lib.rs:227:41
    |
227 |                     let event = ptrace::getevent(pid)? as u8;
    |                                         ^^^^^^^^ not found in `ptrace`

error[E0425]: cannot find function `syscall` in module `ptrace`
   --> src/lib.rs:428:17
    |
428 |         ptrace::syscall(pid, signal)
    |                 ^^^^^^^ not found in `ptrace`
    |
help: consider importing one of these items
    |
72  + use libc::syscall;
    |
72  + use syscalls::mips::Sysno::syscall;
    |
72  + use syscalls::syscall;
    |
help: if you import `syscall`, refer to it directly
    |
428 -         ptrace::syscall(pid, signal)
428 +         syscall(pid, signal)
    |

error[E0425]: cannot find function `getregs` in module `ptrace`
   --> src/lib.rs:434:17
    |
434 |         ptrace::getregs(pid).map_err(|_| anyhow!("Unable to get registers from tracee {}", pid))
    |                 ^^^^^^^ not found in `ptrace`

error[E0308]: mismatched types
   --> src/arch/mod.rs:79:51
    |
79  |         let res: c_long = match ptrace::read(pid, address) {
    |                                 ------------      ^^^^^^^ expected `*mut i8`, found `*mut c_void`
    |                                 |
    |                                 arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut i8`
               found raw pointer `*mut c_void`
note: function defined here
   --> /Users/useradmin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/sys/ptrace/bsd.rs:173:8
    |
173 | pub fn read(pid: Pid, addr: AddressType) -> Result<c_int> {
    |        ^^^^

error[E0308]: mismatched types
  --> src/arch/mod.rs:80:27
   |
80 |             Ok(c_long) => c_long,
   |                           ^^^^^^ expected `i64`, found `i32`
   |
help: you can convert an `i32` to an `i64`
   |
80 |             Ok(c_long) => c_long.into(),
   |                                 +++++++

error[E0599]: no variant or associated item named `PtraceEvent` found for enum `WaitStatus` in the current scope
   --> src/lib.rs:212:29
    |
212 |                 WaitStatus::PtraceEvent(pid, _, code) => {
    |                             ^^^^^^^^^^^ variant or associated item not found in `WaitStatus`

error[E0599]: no variant or associated item named `PtraceSyscall` found for enum `WaitStatus` in the current scope
   --> src/lib.rs:222:29
    |
222 |                 WaitStatus::PtraceSyscall(pid) => {
    |                             ^^^^^^^^^^^^^ variant or associated item not found in `WaitStatus`

Some errors have detailed explanations: E0308, E0425, E0432, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `lurk-cli` (lib) due to 16 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `lurk-cli v0.3.6 (https://github.com/JakWai01/lurk#f28e066d)`, intermediate artifacts can be found at `/tmp/cargo-installtPIwb3`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@orhun
Copy link
Collaborator

orhun commented Sep 12, 2024

perhaps we could have a v0.3.7 release of the crate?

Good point, for a second I forgot I was a collaborator on this repo. Will get to that soon :)

@orhun
Copy link
Collaborator

orhun commented Sep 14, 2024

@artist321
Copy link

artist321 commented Sep 17, 2024

No compile on Mac M1: Compiling lurk-cli v0.3.7
error[E0432]: unresolved import libc::user_regs_struct
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/arch/mod.rs:3:33
|
3 | use libc::{c_long, c_ulonglong, user_regs_struct};
| ^^^^^^^^^^^^^^^^ no user_regs_struct in the root

error[E0432]: unresolved import nix::sys::ptrace::Options
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/arch/mod.rs:5:5
|
5 | use nix::sys::ptrace::Options;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ no Options in sys::ptrace

error[E0432]: unresolved import libc::user_regs_struct
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/arch/aarch64.rs:2:25
|
2 | use libc::{c_ulonglong, user_regs_struct};
| ^^^^^^^^^^^^^^^^ no user_regs_struct in the root
|
= help: consider importing this unresolved item through its public re-export instead:
crate::arch::user_regs_struct

error[E0432]: unresolved import libc::user_regs_struct
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/syscall_info.rs:3:25
|
3 | use libc::{c_ulonglong, user_regs_struct};
| ^^^^^^^^^^^^^^^^ no user_regs_struct in the root

error[E0432]: unresolved import libc::user_regs_struct
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/lib.rs:77:5
|
77 | use libc::user_regs_struct;
| ^^^^^^^^^^^^^^^^^^^^^^ no user_regs_struct in the root

error[E0432]: unresolved imports linux_personality::personality, linux_personality::ADDR_NO_RANDOMIZE
--> /Users/artem/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lurk-cli-0.3.7/src/lib.rs:78:25
|
78 | use linux_personality::{personality, ADDR_NO_RANDOMIZE};
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ no ADDR_NO_RANDOMIZE in the root
| |
| no personality in the root
|
= help: consider importing one of these variants instead:
crate::Sysno::personality
syscalls::Sysno::personality
syscalls::arm::Sysno::personality
syscalls::mips64::Sysno::personality
syscalls::mips::Sysno::personality
syscalls::powerpc64::Sysno::personality
syscalls::powerpc::Sysno::personality
syscalls::riscv32::Sysno::personality
syscalls::riscv64::Sysno::personality
syscalls::s390x::Sysno::personality
syscalls::sparc64::Sysno::personality
syscalls::sparc::Sysno::personality
syscalls::x86::Sysno::personality
syscalls::x86_64::Sysno::personality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants