Debugging an evil Go runtime bug
marcan.st
Debugging an evil Go runtime bug
1–10 of 51 posts
Re: Debugging an evil Go runtime bug
#2Why doesn't the vDSO code just use MOV in its stack probe probe rather than an OR?
Re: Debugging an evil Go runtime bug
#3Why doesn't the vDSO code just use MOV in its stack probe probe rather than an OR?
My best guess would be to prevent the 'useless instruction' from being optimized out, but an or with 0 is still useless, and I don't see what optimizer lies between this GCC feature and the final binary.
Maybe the segfault only occurs on a write?
Re: Debugging an evil Go runtime bug
#4Why doesn't the vDSO code just use MOV in its stack probe probe rather than an OR?
Apparently, because it's shorter [0].
[0]: See https://lkml.org/lkml/2017/11/10/348
Re: Debugging an evil Go runtime bug
#5Why doesn't the vDSO code just use MOV in its stack probe probe rather than an OR?
Apparently, because it's shorter [0]. [0]: See https://lkml.org/lkml/2017/11/10/348
Why is it shorter? Both MOV and OR have one byte encodings, and with the OR you either have to use an immediate zero (which burns a byte) or materialize zero in some other way. As that email points out, the entire sequence would be shorter using a different addressing mode anyways. And a read-modify-write is definitely slower at runtime.
Re: Debugging an evil Go runtime bug
#6The investigation in the linked Go issue [1] is also impressive.
Re: Debugging an evil Go runtime bug
#7The investigation in the linked Go issue [1] is also impressive. [1] https://github.com/golang/go/issues/20427
Don't forget about this one, similar but affects BSD and still open:
Re: Debugging an evil Go runtime bug
#8this is incredibly impressive
Re: Debugging an evil Go runtime bug
#9this is incredibly impressive
That was Captain Ahab level persistence. I wonder how long it took him.
Re: Debugging an evil Go runtime bug
#10Marcan's attitude is great; I know of a ton of people (myself included) who would've written that article with far more complaining interleaved. Super informative as well, I learned a ton from this article (GRUB 2 feature for marking off bad RAM? Wow!). Very well written, informative, humorous, etc. Love it