[Patch] weston-launch: Fix tight poll/recvmsg loop on weston exit
Derek Foreman
derekf at osg.samsung.com
Thu May 14 13:43:25 PDT 2015
On 27/03/15 07:29 AM, Bruno Prémont wrote:
> When weston fails to run while being launched by weston-launch it's
> socketpair causes poll() to notify POLLIN|POLLHUP and lets recvmsg()
> return 0.
>
> Properly cleanup and exit in that case instead of poll()ing in a tight
> loop and leaving tty in graphics mode if we get SIGKILLed as only way
> out.
>
> This happens only when weston-launch (and weston) are being traced
> as in `strace -f weston-launch` as then signalfd is not passing the
> SIGCHLD signal.
How would I go about reproducing this bug?
When I strace -f weston-launch sigchild gets through just fine.
>
> Signed-off-by: Bruno Prémont <bonbons at linux-vserver.org>
> ---
> --- a/src/weston-launch.c 2015-03-01 18:46:27.289835438 +0100
> +++ b/src/weston-launch.c 2015-03-01 18:46:24.599835453 +0100
> @@ -771,6 +771,8 @@ main(int argc, char *argv[])
> error(0, errno, "poll failed");
> if (fds[0].revents & POLLIN)
> handle_socket_msg(&wl);
> + if (fds[0].revents & POLLHUP)
> + quit(&wl, 0);
> if (fds[1].revents)
> handle_signal(&wl);
> }
>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
More information about the wayland-devel
mailing list