3 ms·
We actually address it in the post - https://metalbear.co/blog/hooking-go-from-rust-hitchhikers-guide-to-the-go-laxy/#why-did-this-goroutine-panic-with-our-hook
by aviramha 4y ago
We actually address it in the post - https://metalbear.co/blog/hooking-go-from-rust-hitchhikers-guide-to-the-go-laxy/#why-did-this-goroutine-panic-with-our-hook https://metalbear.co/blog/hooking-go-from-rust-hitchhikers-g...
> "Goroutine stack is dynamic, i.e. it is constantly expanding/shrinking depending on the current needs. This means any common code that runs in system stack assumes it can grow as it wishes (until it exceeds max stack size) while actually, it can’t unless using Go APIs for expanding. Our Rust code isn’t aware of it, so it uses parts of the stack that aren’t actually usable and causes stack overflow."
tl;dr - yes, you're correct and we replace Go stack with system stack for the duration of the call, just like cgo does.
- scottlamb 4y agoThanks, I somehow missed that whole section!