-
Notifications
You must be signed in to change notification settings - Fork 179
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
macOS 10.15 syscall.Mprotect panic: permission denied #10
Comments
My Mac OS is 10.13.6, it has no this problem. |
Catalina(10.15.2) has this problem. Sudo can't solve the problem |
does anybody figure this out |
getting the same problem as well. anyone solved it? |
I am also facing this issue any idea what's the resolution? |
me too. |
I don't know how to fix this ,but I found a way to bypass this. |
+1 |
// modify_binary_darwin.go If your macOS is Catalina 10.15.x, please try to replace "err := syscall.Mprotect(page, syscall.PROT_READ|syscall.PROT_WRITE|syscall.PROT_EXEC)" with "err := syscall.Mprotect(page, syscall.PROT_READ|syscall.PROT_WRITE)" or "err := syscall.Mprotect(page, syscall.PROT_WRITE)". |
Please try Refer to https://stackoverflow.com/questions/60654834/using-mprotect-to-make-text-segment-writable-on-macos . |
Good idea! Maybe it is the best way to fix this. |
Does anyone try this? |
I don't know how to set |
It works on my Mac with macOS 10.15.5.
go test actually includes three steps:
To work around this issue, we need to first generate the test binary, the modify the compiled binary with dd. e.g.
With
Finally, you can run the test binary:
|
i try this ,but i can't solve the problem, |
There are two methods:
|
can solve the problem,But it's too cumbersome to execute every time So,It is recommended to use docker to solve this problem。 |
i also meet the problem and use this method but i want to know that if gomonkey can fix it ? |
+1 |
It may be the best solution of this problem. |
It's work well! |
The best way is to use docker. |
i found a repository: https://github.com/eisenxp/macos-golink-wrapper |
arm64 MacOS can use amd64 version go, I change to go1.16.11 darwin/amd64,and https://github.com/eisenxp/macos-golink-wrapper |
谢谢哟,愿你开心每一天~
|
it will be get other question. such as: can not debug. |
谢谢哟,愿你开心每一天~
|
v2.11.0 has been released! |
谢谢哟,愿你开心每一天~
|
Hi:
After I was update my macOS to about 10.14, It will report panic: permission denied when I run ApplyFunc or ApplyMethod. I searched this problem in google, but I don't have answer. Which permission I should set?
Thanks a lot.
This is panic stack.
panic: permission denied [recovered]
panic: permission denied
goroutine 13 [running]:
testing.tRunner.func1(0xc4202081e0)
/.../goroot/go/src/testing/testing.go:742 +0x29d
panic(0x4e697e0, 0xc4205a7c18)
/.../goroot/go/src/runtime/panic.go:502 +0x229
github.com/agiledragon/gomonkey.modifyBinary(0x4bf4570, 0xc420229a7c, 0xc, 0xc)
/.../gopath/src/github.com/agiledragon/gomonkey/modify_binary_darwin.go:11 +0x198
github.com/agiledragon/gomonkey.replace(0x4bf4570, 0x5099668, 0xc420229b58, 0x59aa580, 0x4dd7500)
/.../gopath/src/github.com/agiledragon/gomonkey/patch.go:164 +0x112
github.com/agiledragon/gomonkey.(*Patches).applyCore(0xc420086c40, 0x4dd7560, 0x5099ba8, 0x13, 0x4dd7560, 0x5099668, 0x13, 0x10)
/.../gopath/src/github.com/agiledragon/gomonkey/patch.go:140 +0x161
github.com/agiledragon/gomonkey.(*Patches).ApplyFunc(0xc420086c40, 0x4dd7560, 0x5099ba8, 0x4dd7560, 0x5099668, 0x4009d7d)
/.../gopath/src/github.com/agiledragon/gomonkey/patch.go:60 +0xbf
github.com/agiledragon/gomonkey.ApplyFunc(0x4dd7560, 0x5099ba8, 0x4dd7560, 0x5099668, 0x2ae)
/.../gopath/src/github.com/agiledragon/gomonkey/patch.go:22 +0xa2
The text was updated successfully, but these errors were encountered: