agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
2k stars 179 forks source link

permission denied #76

Closed xnnyeYp closed 2 years ago

xnnyeYp commented 2 years ago

err := mprotectCrossPage(target, len(bytes), syscall.PROT_READ|syscall.PROT_WRITE|syscall.PROT_EXEC) if err != nil { panic(err) }

这里会panic,permission denied

os: MacBook Pro (13-inch, M1, 2020) M1芯片

别的issue里提供的方法我都试了, 请问有什么办法可以解决这个问题吗

sssion commented 2 years ago

only add 'GOARCH=amd64' in Environment setting, it seems that the author not solves the problem perfectly

agiledragon commented 2 years ago

Please try to this method, https://github.com/agiledragon/gomonkey/issues/70 @xnnyeYp @sssion @bbrodriges @taoso