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

EXC_BAD_ACCESS (Code Signature Invalid) on M1 #2217

Open
splmatto opened this issue Nov 25, 2021 · 5 comments
Open

EXC_BAD_ACCESS (Code Signature Invalid) on M1 #2217

splmatto opened this issue Nov 25, 2021 · 5 comments

Comments

@splmatto
Copy link
Contributor

Host operating system: output of uname -a

Darwin m1minimatto01 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:38 PDT 2021; root:xnu-7195.141.8~1/RELEASE_ARM64_T8101 arm64

node_exporter version: output of node_exporter --version

1.3.0

node_exporter command line flags

N/A

Are you running node_exporter in Docker?

No.

What did you do that produced an error?

./node_exporter --version

What did you expect to see?

normal process startup

What did you see instead?

zsh: killed ./node_exporter --version

From ~/Library/Logs/DiagnosticReports/node_exporter_2021-11-24-183421_m1minimatto01.crash:

Path:                  /private/var/tmp/*/node_exporter
Identifier:            node_exporter
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        zsh [66552]
User ID:               501

Date/Time:             2021-11-24 18:34:13.890 -0800
OS Version:            macOS 11.6.1 (20G224)
Report Version:        12
Anonymous UUID:        1402C51B-C2D2-3335-DB7D-371D75A460F2

Sleep/Wake UUID:       0278B6A8-868D-4234-BA26-521B35406C0D

Time Awake Since Boot: 160000 seconds
Time Since Wake:       38000 seconds

System Integrity Protection: enabled

Crashed Thread:        Unknown

Exception Type:        EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes:       0x0000000000000032, 0x00000001005f4000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 0x2
@discordianfish
Copy link
Member

This seems relevant: https://stackoverflow.com/a/41868747

@Esysc
Copy link

Esysc commented Mar 30, 2022

Same with version 1.3.1 and MacOS Monterey 12.2.1:

./node_exporter --version
Killed: 9
codesign -v node_exporter 
node_exporter: invalid signature (code or signature have been modified)
In architecture: arm64

@discordianfish
Copy link
Member

Actually I guess this is expected given that we don't sign the code. Can you try https://github.molgen.mpg.de/pages/bs/macOSnotes/mac/mac_procs_unsigned.html

@Esysc
Copy link

Esysc commented Mar 30, 2022

Actually I guess this is expected given that we don't sign the code. Can you try https://github.molgen.mpg.de/pages/bs/macOSnotes/mac/mac_procs_unsigned.html

I've tried and I got the same result. I don't think that is because the binary is not signed, for example on Mac x86_64 it works:

./node_exporter --version
node_exporter, version 1.3.1 (branch: HEAD, revision: a2321e7b940ddcff26873612bccdf7cd4c42b6b6)
  build user:       root@6da4230b7124
  build date:       20211205-11:13:08
  go version:       go1.17.3
  platform:         darwin/amd64
codesign -vvv node_exporter 
node_exporter: code object is not signed at all
In architecture: x86_64

But this is MacOS 11.4.

You can see the difference, here code object is not signed at all while for arm64 invalid signature (code or signature have been modified)

@Esysc
Copy link

Esysc commented Apr 14, 2022

the workaround that worked for me:

/usr/bin/codesign --force --deep --sign - /path/to/node_exporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants