Hacker News new | ask | show | jobs
by acqq 4252 days ago
> The kernel delivers the the signals in the correct order only to have userland invert them on the stack.

So does it mean that it's not a kernel bug at all? Just the libc? Then it's not surprising that different kernels, all using the same libc, have the same bug?

2 comments

All kernels do not use the same libc. In fact, Linux is different in the fact that it doesn't ship a libc with the kernel. Illumos, the OS I investigated, goes by the philosophy that you _have_ to ship libc with your kernel, and thus they have their own libc.

My diagnosis for Illumos may not hold up on other OSs, they may invert priority for other reasons. In any case the spec is fairly clear that a signal is considered delivered when the "appropriate action" is taken. In this case the appropriate action is to invoke the user's handler, which is above libc on the stack.

Finally, in case you missed it, I witnessed 4 unique orderings across the systems I tested. They were not the same across the board.

These different kernels do not use the same libc. In particular, BSD derivatives are using a BSD libc, while Linux and friends are using glibc (or some cousin). I'm not certain which libc the others are using, but they are likely separate forks as well.