4 ms·
This gets rather over my head, but my best guess is this bug having to do with the Go runtime underestimating how much stack space vDSO code may need (blog post
by aw1621107 5y ago
This gets rather over my head, but my best guess is this bug having to do with the Go runtime underestimating how much stack space vDSO code may need (blog post at [0], fix at [1]).
[0]: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/ https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
[1]: https://github.com/golang/go/commit/a158382b1c9c0b95a7d41865a405736be6bc585f https://github.com/golang/go/commit/a158382b1c9c0b95a7d41865...
- mananaysiempre 5y ago> I built 32 kernels, one for each bit of the SHA-1 prefix, which only took 29 minutes. Oh, that is evil, thank you. I even encountered a link to this article a couple of months ago[1], but wasn’t hooked enough to go and read it. Though the conclusion sounds somewhat dubious to me: the kernel doesn’t document or control stack usage limits for the vDSO, they happen to blow way up on a system built with obscure (if arguably well-motivated) compiler options, a language runtime that tries to minimize stack usage crashes as a result, and somehow the fault is with the runtime in question for not going via libc (which happens to virtually always run with a large stack and a guard page, thus turning this insidious concurrent memory corruption bug into a mere extremely unlikely crash)? More like we’re collectively garbage at accounting for our stack usage. To be fair to the kernel developers, I would also never guess, looking at this implementation of clock_gettime() [2], that you could compile it in such a way that it ends up requiring 4K of stack space on pain of memory corruption in concurrent programs only (it originating in the kernel source tree has little to do with the bug, it’s just weirdly-compiled userspace C code executing on a small unguarded stack). [1] in <https://utcc.utoronto.ca/~cks/space/blog/unix/UnixAPIAndCRuntime https://utcc.utoronto.ca/~cks/space/blog/unix/UnixAPIAndCRun...> via <https://utcc.utoronto.ca/~cks/space/blog/programming/CStackSizeInvisible https://utcc.utoronto.ca/~cks/space/blog/programming/CStackS...>, <https://utcc.utoronto.ca/~cks/space/blog/unix/StackSizeLimitWhen https://utcc.utoronto.ca/~cks/space/blog/unix/StackSizeLimit...>, and <https://utcc.utoronto.ca/~cks/space/blog/tech/StackSizeLimitWhy https://utcc.utoronto.ca/~cks/space/blog/tech/StackSizeLimit...>. [2] https://elixir.bootlin.com/linux/latest/C/ident/__cvdso_clock_gettime https://elixir.bootlin.com/linux/latest/C/ident/__cvdso_cloc...
- mananaysiempre 5y ago... And a closer look at one of the Go bugs involved[1] also reveals the kernel build system will now also unconditionally disable the offending stack probing flag[2], as it leaked even into the kernel-space configuration where it would do more straightforward damage. [1] https://github.com/golang/go/issues/20427#issuecomment-360018019 https://github.com/golang/go/issues/20427#issuecomment-36001... [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3ce120b16cc548472f80cf8644f90eda958cf1b6 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
- mananaysiempre 5y agoBy the way, that hashing trick somehow reminds me of edge-notched cards[1]. (Not old enough to have used them, old enough to have seen and played with them.) [1] https://boingboing.net/2008/06/17/edgenotched-cards-st.html https://boingboing.net/2008/06/17/edgenotched-cards-st.html
- deleted 5y ago[deleted]