Re: [dev] Infnite loop in drawbar() when using attachbelow and sending windows between monitors

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat, 6 Jun 2020 13:11:02 +0200

On Thu, Jun 04, 2020 at 01:19:15PM +0200, Jakub Leszczak wrote:
> There is a bug in attachbelow patch.
>
> Change one line inside attachBelow() function.
>
> - if(c->mon->sel == NULL || c->mon->sel->isfloating) {
> + if (c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating) {
>
> Br,
> Jakub Leszczak
>
> On Thu, Jun 4, 2020 at 12:17 PM Cadey Alicia Ratio <cadey_AT_firemail.cc> wrote:
> >
> > I have found a bit of a peculiar issue when using the [attachbelow][1]
> > patch. It seems that when you send windows between monitors using it,
> > it creates a circular linked list that causes the following block of
> > code to create an infinite loop:
> >
> > for (c = m->clients; c; c = c->next) {
> > occ |= c->tags;
> > if (c->isurgent)
> > urg |= c->tags;
> > }
> >
> > If you end up running into this while dwm is running, you can attach to
> > the process with gdb and do the following to unstuck it:
> >
> > bt full (to verify you are in drawbar())
> > set c->next = 0x0
> >
> > This should unbreak dwm until the next time you attempt to send a window
> > between monitors.
> >
> > I have tried to debug this further, but I seem to be reaching the limits
> > of my C knowledge trying to diagnose and fix the root cause.
> >
> > This seems to show up most often when there is only one window on the
> > monitor.
> >
> > Any advice would be appreciated.
> >
> > Be well,
> >
> > Cadey Ratio
> >
> > ---
> >
> > la budza pu cusku lu
> > <<.i ko do snura .i ko do kanro
> > .i ko do panpi .i ko do gleki
> >
>

Hi,

Nice work,

I don't use this patch, but can someone push it to the wiki so anyone can
easily use the fix?
https://git.suckless.org/sites/

The wiki can be pushed to by anyone:
https://suckless.org/wiki/

At:
https://dwm.suckless.org/patches/attachbelow/

Thanks,

-- 
Kind regards,
Hiltjo
Received on Sat Jun 06 2020 - 13:11:02 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 06 2020 - 13:12:09 CEST