darkfeline / wmii

Automatically exported from code.google.com/p/wmii
MIT License
0 stars 0 forks source link

Sometimes removes all screens, resulting in SIGSEGV ([patch] included) #270

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure X11 to have two screens with the same size and position in 
Xinerama (such that they eqrect() eachother).  This recently became the default 
for my Nvidia 9400GT (formerly, it had DVI and VGA enabled, overlapping, but 
VGA smaller.  Now, VGA defaults to the same resolution).
2. Start wmii.
3. Observe the segfault when it tries to dereference a null pointer.

When init_screens() weeds out subsumed screens, if two screens eqrect() 
eachother, they are *both* removed, which is wrong.  If they are the only 
screens, then nscreens ends ups as 0.  Then, when it sets `screen = 
screens[0]`.  When main() tries to dereference screen->barwin, crashes happen.

I've written a patch to fix this.

Original issue reported on code.google.com by luke.t.s...@gmail.com on 16 Jan 2015 at 6:14

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, that patch was incorrect; I forgot to decrement i when decrementing n.

Also, I really must apologize for re-thinking the entire loop.  I just can't 
reason about it the way it was written.

Original comment by luke.t.s...@gmail.com on 16 Jan 2015 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, this is with wmii from hg; commit d60ef77c8866

Original comment by luke.t.s...@gmail.com on 16 Jan 2015 at 9:36