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

[BUG] simpleperf does not run on macOS when installed by Android Studio #1757

Closed
DanAlbert opened this issue Aug 25, 2022 · 3 comments
Closed
Assignees
Labels

Comments

@DanAlbert
Copy link
Member

Description

Mirroring internal bug http://b/241493489.

danalbert-macbookpro2 :: ~ » Library/Android/sdk/ndk/25.0.8775105/simpleperf/bin/darwin/x86_64/simpleperf
[1]    68271 killed     Library/Android/sdk/ndk/25.0.8775105/simpleperf/bin/darwin/x86_64/simpleperf

The logs (via /usr/bin/log show) imply this is an issue with signing:

2022-08-25 12:01:14.425139-0700 0xa24b7    Default     0x0                  0      0    kernel: CODE SIGNING: cs_invalid_page(0x1044dc000): p=68319[simpleperf] final status 0x23020200, denying page sending SIGKILL
2022-08-25 12:01:14.425167-0700 0xa24b7    Default     0x0                  0      0    kernel: CODE SIGNING: process 68319[simpleperf]: rejecting invalid page at address 0x1044dc000 from offset 0xa48000 in file "/Users/danalbert/Library/Android/sdk/ndk/25.0.8775105/simpleperf/bin/darwin/x86_64/simpleperf" (cs_mtime:1659027423.751343174 == mtime:1659027423.751343174) (signed:1 validated:1 tainted:1 nx:0 wpmapped:0 dirty:0 depth:0)

xattr reports that simpleperf is not quarantined. Attributes and signing state appears to match that of clang, which runs fine.

I have the same problem when running simpleperf from the prebuilts directory, so I think it was broken before it reached the NDK:

danalbert-macbookpro2 :: ~ » /Volumes/src/ndk/prebuilts/simpleperf/bin/darwin/x86_64/simpleperf
[1]    68469 killed     /Volumes/src/ndk/prebuilts/simpleperf/bin/darwin/x86_64/simpleperf

Aside from fixing this, we need to investigate why QA didn't catch this.

Affected versions

r25

Canary version

No response

Host OS

Mac

Host OS version

12.5.1

Affected ABIs

armeabi-v7a, arm64-v8a, x86, x86_64

Build system

Other (specify below)

Other build system

n/a

minSdkVersion

n/a

Device API level

n/a

@DanAlbert DanAlbert added the bug label Aug 25, 2022
@DanAlbert DanAlbert moved this to Triaged in NDK r25c Aug 25, 2022
@benjaminRomano
Copy link

Just ran into this when using simpleperf scripts from NDK. To workaround, I ran the following commands:

sudo codesign -f -s - bin/darwin/x86_64/libsimpleperf_report.dylib
sudo codesign -f -s - bin/darwin/x86_64/simpleperf

@stephenhines
Copy link
Collaborator

@yabinc as FYI

@DanAlbert DanAlbert self-assigned this Sep 15, 2022
@DanAlbert DanAlbert moved this from Triaged to Needs prebuilt update in NDK r25c Nov 16, 2022
@DanAlbert DanAlbert moved this from Needs prebuilt update to Needs cherry-pick in NDK r25c Jan 17, 2023
@DanAlbert DanAlbert moved this from Needs cherry-pick to Merged in NDK r25c Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Merged
Development

No branches or pull requests

3 participants