Re: [Sawfish] periodic segfault |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [Sawfish] periodic segfault
- From: Teika Kazura <teika@xxxxxxxxxxx>
- Date: Thu, 23 Feb 2012 08:32:44 +0900 (JST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=FM+gUO01jjXtCpS6Kn/IW3WudvnaJaIDXASywEFN4P+KGx03yOQj+dOI9HQ8T3YUmKuwqIIYFmtlYBuKUffL6LVYn/ERS6/rC64rc58pOjkL4yTk8CFLz/c6/Dzj0SiN4I6W4KGWWSQHP4GP7qyWyo2AQeUSzzRoWuSIqKHA16g=; h=Date:Message-Id:To:Subject:From:In-Reply-To:References:Mime-Version:Content-Type:Content-Transfer-Encoding;
Hi. This looks very annoying. How can it happen?
Let's see the function. It's simple.
------------------------------------------------------------------------
void
refresh_frame_part (struct frame_part *fp)
{
if (!frame_draw_mutex)
{
Lisp_Window *w = fp->win;
if (w == 0) /* XXX why is this needed? */
return;
if (fp->drawn.width != fp->width || fp->drawn.height != fp->height)
fp->drawn.bg = rep_NULL;
if (!WINDOW_IS_GONE_P (w) && fp->id != 0) /* It happened here */
set_frame_part_bg (fp);
if (!WINDOW_IS_GONE_P (w) && fp->id != 0)
set_frame_part_fg (fp);
fp->drawn.width = fp->width;
fp->drawn.height = fp->height;
fp->pending_refresh = 0;
}
else
fp->pending_refresh = 1;
}
------------------------------------------------------------------------
In X, each frame components (top, bottom, buttons, etc) are drawed in
a separate window, and there exists a window which contains all of the
client (= application) window and the frame components. (Such kind of
window managers are called "reparenting WMs".) refresh_frame_part() is
a function to redraw a frame part (= a frame component).
fp->win is the window associated with the concerned frame part,
represented as a librep lisp object. ** And the check follows if it's
not NULL. **
It seems WINDOW_IS_GONE_P segfaults, but it's defined in sawfish.h as:
#define WINDOW_IS_GONE_P(w) (w->id == 0)
But w is not NULL! I'm lost here.
Hmm. Will it help to replace
(w == 0) with
(w == 0 || ! WINDOWP(w)) ?
But this is simply sweeping the true bug under the carpet, and it
may lead to a worse situation.
Anyone?
Teika (Teika kazura)
--
--
Sawfish ML