Live data from Hacker News

Debugging an evil Go runtime bug

marcan.st

31–40 of 51 posts

Re: Debugging an evil Go runtime bug

#32
post #19

Setting up for a 104 byte stack seems pretty crazy, wouldn't you risk overrunning the red zone even without all that stack probing? https://en.wikipedia.org/wiki/Red_zone_(computing)

The redzone is only non-explicit stack and only really matters if you violate it. If vDSO allocates stack properly, which it should considering it's an exported function, there is no problem.

Re: Debugging an evil Go runtime bug

#33
Wow, these are some serious debugging skills. I also admire the tenacity and the will to investigate the root cause.

> I tried setting GOMAXPROCS=1, which tells Go to only use a single OS-level thread to run Go code. This also stopped the crashes, again pointing strongly to a concurrency issue.

I think I would have stopped there.

Re: Debugging an evil Go runtime bug

#35

Wow, these are some serious debugging skills. I also admire the tenacity and the will to investigate the root cause. > I tried setting GOMAXPROCS=1, which tells Go to only use a single OS-level thread to run Go code. This also stopped the crashes, again pointing strongly to a concurrency issue. I think I would have stopped there.

[deleted]

Re: Debugging an evil Go runtime bug

#39
post #36

Earlier quoted context omitted.

That was Captain Ahab level persistence. I wonder how long it took him.

I was one of the spectators on the Prometheus thread. It took him 2 days. It was insane.

I ordinarily speak against the whole "10x engineer" trope, but this case would've easily taken me 20 days. Or months.

Re: Debugging an evil Go runtime bug

#40
post #32
post #19

Setting up for a 104 byte stack seems pretty crazy, wouldn't you risk overrunning the red zone even without all that stack probing? https://en.wikipedia.org/wiki/Red_zone_(computing)

The redzone is only non-explicit stack and only really matters if you violate it. If vDSO allocates stack properly, which it should considering it's an exported function, there is no problem.

How does being an exported function change the rules, I thought the x86-64 ABI mandated an implicit safe 128 bytes below rsp at all times? Also, how can a vDSO function "allocate" stack? It would have to know about the current stack space as configured by the go runtime, and somehow dig into this go-runtime-specific record of the current stack limit? Isn't the only available option for any exported function just to /use/ pre-allocated stack space (by subtracting from rsp) - I don't see how it could possibly extend the pre-allocated stack.
Post reply on HN