Closed zohu closed 2 years ago
panic: tls: fail to call mprotect(addr=0x10618d910, size=40, prot=0x2) with error invalid argument
goroutine 1 [running]: github.com/huandu/go-tls.mprotect(0x10618d910, 0x28, 0x2) /Users/xxx/work/go/pkg/mod/github.com/huandu/go-tls@v1.0.1/syscall_unix.go:34 +0x250 github.com/huandu/go-tls.init.1() /Users/xxx/work/go/pkg/mod/github.com/huandu/go-tls@v1.0.1/goexit.go:63 +0xd8 Exiting.
Debugger finished with the exit code 0
好吧,是因为用了1.17
Go1.17 是会有问题,但是你这个问题最主要的还是因为触发了 Mac DEP 机制,不允许将 read-only 内存修改成 read-write,之前都是因为用到了 GCCGo 编译造成的问题,不知道你这个是不是这样。
所以使用cgo就不能用这个库吗?
Cgo 应该是没问题,有问题的是 GCCGo。不过我现在没有最新的 M1 Max 机器,不知道现在是不是 Cgo 也不行了。
panic: tls: fail to call mprotect(addr=0x10618d910, size=40, prot=0x2) with error invalid argument
goroutine 1 [running]: github.com/huandu/go-tls.mprotect(0x10618d910, 0x28, 0x2) /Users/xxx/work/go/pkg/mod/github.com/huandu/go-tls@v1.0.1/syscall_unix.go:34 +0x250 github.com/huandu/go-tls.init.1() /Users/xxx/work/go/pkg/mod/github.com/huandu/go-tls@v1.0.1/goexit.go:63 +0xd8 Exiting.
Debugger finished with the exit code 0