gomonkey icon indicating copy to clipboard operation
gomonkey copied to clipboard

panic: permission denied [recovered] macOS 12 apple m1 pro

Open hao1032 opened this issue 2 years ago • 23 comments

image

` === RUN Test_Trigger --- FAIL: Test_Trigger (0.34s) panic: permission denied [recovered] panic: permission denied

goroutine 117 [running]: testing.tRunner.func1.2(0x101d08920, 0x102a6bc88) /Users/tango/sdk/go1.16.13/src/testing/testing.go:1143 +0x25c testing.tRunner.func1(0x1400060e480) /Users/tango/sdk/go1.16.13/src/testing/testing.go:1146 +0x384 panic(0x101d08920, 0x102a6bc88) /Users/tango/sdk/go1.16.13/src/runtime/panic.go:965 +0x14c github.com/agiledragon/gomonkey/v2.modifyBinary(0x10155ca90, 0x14000f22198, 0x18, 0x18) /Users/tango/go/pkg/mod/github.com/agiledragon/gomonkey/[email protected]/modify_binary_darwin.go:9 +0xec github.com/agiledragon/gomonkey/v2.replace(0x10155ca90, 0x14001e79960, 0x14001f58ed0, 0x14001f59a90, 0x101be0500) /Users/tango/go/pkg/mod/github.com/agiledragon/gomonkey/[email protected]/patch.go:196 +0xb8 github.com/agiledragon/gomonkey/v2.(*Patches).ApplyCore(0x14001f59008, 0x101be05a0, 0x101f0e150, 0x13, 0x101be05a0, 0x14001e79960, 0x13, 0x1016cd448) /Users/tango/go/pkg/mod/github.com/agiledragon/gomonkey/[email protected]/patch.go:158 +0x104 github.com/agiledragon/gomonkey/v2.(*Patches).ApplyFunc(0x14001f59008, 0x101be05a0, 0x101f0e150, 0x101be05a0, 0x14001e79960, 0x4) /Users/tango/go/pkg/mod/github.com/agiledragon/gomonkey/[email protected]/patch.go:66 +0x138 github.com/agiledragon/gomonkey/v2.ApplyFunc(...) /Users/tango/go/pkg/mod/github.com/agiledragon/gomonkey/[email protected]/patch.go:24 git.code.oa.com/fabriceli/drules/service/cmd/ruleshub.initMock(0x14000024eb8, 0x10089b3a4) /Users/tango/Code/GolandProjects/drules/service/cmd/ruleshub/main_test.go:62 +0x224 /Users/tango/Code/GolandProjects/drules/service/cmd/ruleshub/main_test.go:35 +0x9c testing.tRunner(0x1400060e480, 0x101f0e100) /Users/tango/sdk/go1.16.13/src/testing/testing.go:1193 +0xd8 created by testing.(*T).Run /Users/tango/sdk/go1.16.13/src/testing/testing.go:1238 +0x21c

Process finished with the exit code 1 `

hao1032 avatar Jan 13 '22 17:01 hao1032

export GOARCH=amd64

super-eggs avatar Jan 21 '22 06:01 super-eggs

请问现在是怎么解决这个问题的呀,GOARCH设置为amd64对debug有影响

liuzhaoce avatar Feb 12 '22 08:02 liuzhaoce

export GOARCH=amd64

这样就没法debug了

hao1032 avatar Feb 17 '22 03:02 hao1032

export GOARCH=amd64

这样就没法debug了

确实,目前还没有找到更好的办法。

super-eggs avatar Feb 17 '22 09:02 super-eggs

有找到解决的办法吗?目前除了改GOARCH=amd64还有更好的办法吗?这样不能debug @agiledragon

blanche789 avatar Mar 16 '22 13:03 blanche789

Please try to this method, https://github.com/agiledragon/gomonkey/issues/70 @blanche789

agiledragon avatar Mar 16 '22 21:03 agiledragon

go 1.17.8 #70 方法不行

zhijian-pro avatar Mar 25 '22 08:03 zhijian-pro

Please try to this method: #70 arm64 MacOS can use amd64 version go, I change to go1.16.11 darwin/amd64,and https://github.com/eisenxp/macos-golink-wrapper

agiledragon avatar Apr 03 '22 12:04 agiledragon

I have the same issue,how can I solve it?

89trillion-zhaoyang avatar Apr 15 '22 07:04 89trillion-zhaoyang

I have the same issue too.

LaurenceLiZhixin avatar May 03 '22 17:05 LaurenceLiZhixin

I have the same issue too, and export GOARCH=amd64 can resolve temporary.

WangsYi avatar Jul 05 '22 08:07 WangsYi

image

I have the same issue too, and export GOARCH=amd64 can't resolve temporary.

dino-ma avatar Jul 05 '22 12:07 dino-ma

+1

jiangshuai1995 avatar Aug 04 '22 09:08 jiangshuai1995

I have the same issue too.

lone1y-51 avatar Aug 05 '22 04:08 lone1y-51

我也遇到了

qiu-peng20 avatar Aug 24 '22 03:08 qiu-peng20

现在最新版本有兼容这个问题了吗? 我这边测试还是会报这个错误。

linchupeng avatar Sep 01 '22 10:09 linchupeng

升级到v2.9.0还是出现同样的问题, export GOARCH=amd64 也不起作用,什么时候能修复这个问题

liuzhenchuan avatar Sep 16 '22 02:09 liuzhenchuan

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

linchupeng avatar Sep 16 '22 02:09 linchupeng

This is a limitation of the Apple M1 chip, which does not allow dynamic modification of the content of the code area.

agiledragon avatar Sep 17 '22 13:09 agiledragon

This is a limitation of the Apple M1 chip, which does not allow dynamic modification of the content of the code area.M1 请问下M1笔记本上有办法可以使用吗?

cyniubi avatar Sep 26 '22 04:09 cyniubi

+1,我也遇见了这个问题

LargeOrange avatar Nov 01 '23 06:11 LargeOrange

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

linchupeng avatar Nov 01 '23 06:11 linchupeng

v2.11.0 has been released!

agiledragon avatar Nov 10 '23 04:11 agiledragon