3 ms·
Specifically Go has very particular ideas about memory and stack layout, which do not go well with C libraries. In order to call a C library, Go has to go throu
by vetinari 8y ago
Specifically Go has very particular ideas about memory and stack layout, which do not go well with C libraries. In order to call a C library, Go has to go through thunking shims.
When using syscalls directly, it does not matter. Kernel doesn't care how your laid out your userspace stack.
- cesarb 8y ago> Kernel doesn't care how your laid out your userspace stack. Except when it does: https://github.com/golang/go/issues/20427 https://github.com/golang/go/issues/20427
- zaarn 8y agoIIRC this was because of a rather amusing behaviour of a Gentoo toolchain with some hardening patches, in this case doing a bit of fun on the stack to make sure it's safe. A lot of the hardening patches come with disclaimers that some software might break, and as shown by this bug, for good reason. I'd rather blame the compiler patches for this silly behaviour (and maybe the kernel for not documenting and limiting how much stack VDSO can use)
- ben0x539 8y agoIt's not really obvious to me that the original issue, mentioning os.Exec calls and Ubuntu versions, has the same cause as the crashes from the commenter mentioning patched Gentoo toolchains.