Slide 11
Slide 11 text
Stack growth check: behind the scenes
GOOS=linux
GOARCH=386
go build
objdump -d output (Intel syntax)
gs:0x00
Ptr to ?
Thread Control Block
(TCB)
[TCB - 0x04] → Ptr to g
func foo() {
print(“hello”)
}
0808aae0 :
01 mov ecx,DWORD PTR gs:0x0
02 mov ecx,DWORD PTR [ ecx-0x4]
03 cmp esp,DWORD PTR [ ecx+0x8]
04 jbe 909ab19 (grow stack)
Current g
0x00 stack.lo
0x04 stack.hi
0x08 stackguard0
What things could possibly go wrong here?