Comments (10)
我这里没有问题。能贴一下复现的代码么?
我这里是 Catalina 10.15.3
from go-tls.
感谢回复,我的是10.15.4,完整的报错是:
panic: tls: fail to call mprotect(addr=0x52077f0, size=40, prot=0x2) with error permission denied
goroutine 1 [running]:
github.com/huandu/go-tls.mprotect(0x52077f0, 0x28, 0x2)
/Users/go/pkg/mod/github.com/huandu/[email protected]/syscall_unix.go:34 +0x1bb
github.com/huandu/go-tls.init.1()
/Users/go/pkg/mod/github.com/huandu/[email protected]/goexit.go:62 +0x95
只要一引用就报错
代码是:
func GetGoroutineId() int64 {
return tls.ID()
}
from go-tls.
我还没升级这个版本,可能 MacOSX 升级内存读写策略了,这个就不好办了。这个库需要修改只读段数据,如果不允许这么操作的话,就得用其他方法了,得研究一下。
from go-tls.
我已经升级到 Catalina 10.15.4 (19E266),写了个测试程序并没有发现问题呢。
package main
import (
"fmt"
"github.com/huandu/go-tls"
)
func main() {
tls.Set("foo", tls.MakeData(123))
d, _ := tls.Get("foo")
fmt.Println("foo:", d.Value())
}
from go-tls.
最近又升级到 Catalina 10.15.4 (19E287),依然无法重现这个问题。我先关闭问题了哦,不知道会不会你那里有什么安全软件或者神秘的安全配置造成的问题,似乎不是一个通常会遇到的问题。
from go-tls.
需要使用 tls.AtExit() 这个函数,, 在catalina 10.15 必选, 我和我的同事都遇到了这个问题, 后来使用这个解决问题
printf '\x07' | dd of=$1 bs=1 seek=160 count=1 conv=notrunc
from go-tls.
在catalina 10.15 问题必现
from go-tls.
我之前都看到相关的文章了,比如这篇,不过我的电脑始终无法重现这个问题,我不知道有什么安全设置得打开才会触发这个。我在 Catalina 和现在的 Big Sur 上面都无法复现这个问题,比较奇怪。
from go-tls.
原则上,Go linker 并不会像 clang 一样设置那个标记位,所以不会触发这个问题。莫非是你用了 gogcc 编译?或者有 cgo 的代码?
from go-tls.
原则上,Go linker 并不会像 clang 一样设置那个标记位,所以不会触发这个问题。莫非是你用了 gogcc 编译?或者有 cgo 的代码?
hi 你好,我这边使用到了cgo代码,触发了这个问题,有什么办法能解决吗
from go-tls.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-tls.