Giter Club home page Giter Club logo

go-tls's Introduction

大家好 / Hi there 👋

我是一名来自中国的开发者 🎉

  • 我熟悉各种前端和后端技术架构,各种技术栈上都有很多实战经验。
  • 曾作为技术负责人设计开发过多种不同类型的大型复杂互联网业务架构。
  • 我在 Github 上开源的项目大多与 Go 相关,平时喜欢研究 Go runtime 并解决与之相关的疑难杂症。
  • 当前,我是一个创业公司的合伙人,业务主要与视频相关,开发的技术涵盖播放器、流媒体服务、音视频格式等方面。

I'm a software developer from China. 🎉

  • I have lots of work experience in both front end and back end software.
  • I led the development of multiple large scale and complex projects as chief architecture in the past.
  • Most of my open source projects are writen in Go. I'm fond of investigating and hacking Go runtime to solve complicated issues.
  • Right now, I'm a partner of a start-up company. My business involves lots of video technologies, including video player, video streaming server, video format and so forth.

My Stats

go-tls's People

Contributors

huandu avatar okhowang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-tls's Issues

broken @go1.17

go 1.17 it is relased.

And this repo will broken at the unit test.

Question about using g struct pointer to identify a goroutine

I am looking for a lib to identify a goroutine, and I don't like to use goroutine id.

This lib is promising.

And I have a question: goroutine may migrate between system threads, using g struct pointer to identify a goroutine may be not reliable. What do you think about this situation?

tls.Unload error in goroutine exit

code as fallow:

func CreateGls() {
	zaplog.LoggerSugar.Debugf("GLS create goid:%d", GoID())
	TLS.AtExit(func() {
		zaplog.LoggerSugar.Debugf("GLS delete goid:%d", GoID())
		TLS.Unload()
	})
}

testcase:

func TestAutoReleaseWhenGoExit(t *testing.T) {
	go func() {
		CreateGls()
		time.Sleep(10*time.Second)
	}()

	zaplog.LoggerSugar.Debugf("main goroutine goid:%d", GoID())
	time.Sleep(20*time.Second)
	zaplog.LoggerSugar.Debugf("main goroutine exit")
}

error occurs like this:

=== RUN TestAutoReleaseWhenGoExit
2020-10-20T17:39:25.252+0800 DEBUG gls/gls_test.go:15 main goroutine goid:1
2020-10-20T17:39:25.252+0800 DEBUG gls/gls.go:17 GLS create goid:2
2020-10-20T17:39:35.255+0800 DEBUG gls/gls.go:19 GLS delete goid:2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x12baa6a]

goroutine 6 [running]:
server/internal/common/gls/internal/tls.resetAtExit()
/Users/yc/workspace/goproject/uuu/antia-server/internal/common/gls/internal/tls/tls.go:175 +0x17a
server/internal/common/gls/internal/tls.hackedGoexit1()
/Users/yc/workspace/goproject/uuu/antia-server/internal/common/gls/internal/tls/goexit.go:72 +0x22
created by server/internal/common/gls.TestAutoReleaseWhenGoExit
/Users/yc/workspace/goproject/uuu/antia-server/internal/common/gls/gls_test.go:10 +0x39

Process finished with exit code 1

full link ID based on TLS ?

In order to achieve full link ID tracking, based on TLS in go, in order to avoid function calls need to pass the context param .In the same coroutine, it is OK to get the link ID according to the coroutine ID, but how can one coroutine start another coroutine without obvious the passing link ID?

启动不起来了,Apple M1 Max

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/[email protected]/syscall_unix.go:34 +0x250
github.com/huandu/go-tls.init.1()
/Users/xxx/work/go/pkg/mod/github.com/huandu/[email protected]/goexit.go:63 +0xd8
Exiting.

Debugger finished with the exit code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.