go-kiss / monkey

Go语言猴子补丁框架
https://taoshu.in/go/monkey/
MIT License
117 stars 17 forks source link

panic: permission denied [recovered] #18

Open amosnothing opened 9 months ago

amosnothing commented 9 months ago

=== RUN TestName1 --- FAIL: TestName1 (0.00s) panic: permission denied [recovered] panic: permission denied

goroutine 83 [running]: testing.tRunner.func1.2({0x100ff16a0, 0x1018edb88}) /usr/local/go/src/testing/testing.go:1545 +0x48a testing.tRunner.func1() /usr/local/go/src/testing/testing.go:1548 +0x63f panic({0x100ff16a0?, 0x1018edb88?}) /usr/local/go/src/runtime/panic.go:920 +0x290 github.com/go-kiss/monkey.mprotectCrossPage(0x100ee1c00, 0xd, 0x7) /Users/amos/go/pkg/mod/github.com/go-kiss/monkey@v0.0.0-20231009011513-ca6162e0f308/replace_unix.go:16 +0xf9 github.com/go-kiss/monkey.copyToLocation(0x100ee1c00, {0xc00052fe30, 0xd, 0xd}) /Users/amos/go/pkg/mod/github.com/go-kiss/monkey@v0.0.0-20231009011513-ca6162e0f308/replace_unix.go:27 +0x75 github.com/go-kiss/monkey.(patch).Apply(0xc00022d090) /Users/amos/go/pkg/mod/github.com/go-kiss/monkey@v0.0.0-20231009011513-ca6162e0f308/monkey.go:269 +0x1be github.com/go-kiss/monkey.patchValue({0x100f92de0, 0x101190540, 0x13}, {0x100f92de0, 0x101190520, 0x13}, 0xc00024f6a0) /Users/amos/go/pkg/mod/github.com/go-kiss/monkey@v0.0.0-20231009011513-ca6162e0f308/monkey.go:150 +0x6fc github.com/go-kiss/monkey.Patch({0x100f92de0, 0x101190540}, {0x100f92de0, 0x101190520}, {0x0, 0x0, 0x0}) /Users/amos/go/pkg/mod/github.com/go-kiss/monkey@v0.0.0-20231009011513-ca6162e0f308/monkey.go:54 +0x1e5 data-factory/core/manager.TestName1(0xc000501520) /Users/amos/Code/104-Golang/data-factory/core/manager/import_test.go:24 +0x5f testing.tRunner(0xc000501520, 0x101190460) /usr/local/go/src/testing/testing.go:1595 +0x1c2 created by testing.(T).Run in goroutine 1 /usr/local/go/src/testing/testing.go:1648 +0x7e5

已经添加 -gcflags='all=-N -l' 参数

amosnothing commented 9 months ago

在 goland 上无法运行,但是手动执行命令是可以的。

taoso commented 9 months ago

你用的是 M1/M2 芯片吗?如果是,可以添加环境变量GOARCH=AMD64试试看。

amosnothing commented 8 months ago

你用的是 M1/M2 芯片吗?如果是,可以添加环境变量GOARCH=AMD64试试看。

intel 的

运行不可以,但是调试可以

taoso commented 8 months ago

是不是跟这个问题类似 https://github.com/agiledragon/gomonkey/issues/142

amosnothing commented 8 months ago

是不是跟这个问题类似 agiledragon/gomonkey#142

不是哦,不太一样