metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.84k stars 107 forks source link

"zsh: illegal hardware instruction" on M2 mac since the last frida update #1313

Closed t4lz closed 1 year ago

t4lz commented 1 year ago

Bug Description

When trying to run mirrord exec with some binaries, at first mirrord starts normally, loads into the binary, and hooks everything, but is then killed with:zsh: illegal hardware instruction and the program exits with error code 132.

Steps to Reproduce

  1. scripts/build_fat_mac.sh
  2. target/universal-apple-darwin/debug/mirrord exec --target deployment/py-serv-deployment node

Backtrace

No response

Relevant Logs

2023-04-17T22:30:34.572582Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: close time.busy=2.25µs time.idle=15.8µs orig_fd=23 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572609Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: new orig_fd=24 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572625Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: close time.busy=2.00µs time.idle=14.4µs orig_fd=24 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572657Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: new orig_fd=25 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572672Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: close time.busy=1.96µs time.idle=14.0µs orig_fd=25 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572697Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: new orig_fd=26 cmd=2 fcntl_fd=0
2023-04-17T22:30:34.572713Z TRACE ThreadId(01) fcntl: mirrord_layer::socket::ops: close time.busy=2.00µs time.idle=14.5µs orig_fd=26 cmd=2 fcntl_fd=0
zsh: illegal hardware instruction  MIRRORD_AGENT_RUST_LOG=mirrord=trace RUST_LOG=warn,mirrord=trace  exec

Your operating system and version

macOS 13.3

Local process

/opt/homebrew/bin/node: Mach-O 64-bit executable arm64

Local process version

v19.8.1

Additional Info

Also reproduces with python.

Retraced this back to the commit updating frida (which was the main suspect with that error message, maybe together with SIP). Doesn't happen before that, starts on that commit.

aviramha commented 1 year ago

Sorry, I thought it was fixed in last Frida versions. (Even though my issue wasn't closed https://github.com/frida/frida-gum/issues/698)