Re: [BUG] Odd interaction between uninterruptible syscall and stack overflow

From: Richard Weinberger
Date: Sun Mar 15 2015 - 14:29:19 EST


On Sun, Mar 15, 2015 at 7:12 PM, Simonas <s@xxxxxxxxxxxxx> wrote:
> While working on stack related code in Rustâs stdandard library, I trigerred
> a very odd and amusing
> issue yesterday. Running this short code
>
> #include <stdio.h>
> void recurse(void) {
> puts("");
> recurse();
> }
> int main(void) {
> recurse();
> }
>
> intuitively should SIGSEGV and terminate when the stack is exhausted.
> However, on my system this
> will hang up inside uninterruptible sleep (the D state) for eternity. The
> amusing part is that this
> state will bubble up and also pull various other processes into D state as
> well. Some examples are:
>
> * gnome-terminal (when the window in which this executable was run is
> closed);
> * ps aux;
> * pkill;
> * systemd PID 1 (when the system is being shut downâ presence of this
> infinitely D state
> process will also reliably prevent system from suspending);
>
> I guess this happens because the process receives asynchronous SIGSEGV
> during a call to
> uninterruptible syscall and believe the process should not go into infinite
> D state in this case.
>
> Iâm running Arch Linuxâs stock 3.18.6 (-1-ARCH) x86_64 kernel.
>
> Iâve attached dmesg logs, which has some backtraces. This is my first time
> reporting a kernel
> issue, so if thereâs any information I didnât provide, Iâll gladly provide
> some on request.

Here in 4.0-rc it does not happen.
Do you have a core dumper installed?
i.e. kernel.core_pattern begins with a "|"?

--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/