This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Avoid race condition when handling a SIGWINCH signal
- From: Pedro Alves <palves at redhat dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>, gdb-patches at sourceware dot org
- Date: Wed, 13 May 2015 15:17:52 +0100
- Subject: Re: [PATCH] Avoid race condition when handling a SIGWINCH signal
- Authentication-results: sourceware.org; auth=none
- References: <1431524000-21098-1-git-send-email-patrick at parcs dot ath dot cx>
On 05/13/2015 02:33 PM, Patrick Palka wrote:
> The control variable win_resized must be cleared before responding to
> it.
>
> Otherwise there is a small window where another SIGWINCH might occur in
> between the handling of an earlier SIGWINCH and the clearing of
> win_resized, at which point win_resized would be set (again) by the
> signal handler. Shortly thereafter we would clear win_resized even
> though we only handled the earlier SIGWINCH but not the latest one.
> This chain of events is all avoided if we clear win_resized first.
>
> gdb/ChangeLog:
>
> * tui/tui-win.c (tui_async_resize_screen): Clear win_resized
> first before resizing the window.
> * tui.c (tui_enable): Likewise.
OK.
Thanks,
Pedro Alves