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

Richard Weinberger
2015-03-15T18:29:13Z

On Sun, Mar 15, 2015 at 7:12 PM, Simonas <s@kazlauskas.me> 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