On Fri, Jul 19, 2019 at 1:09 PM Martin Samuelsson <ratpoi...@gyvetre.netizen.se> wrote: > The general idea is of course to figure out if find_screen_by_attr(), > list_first() and XGetWindowAttributes() seem to be called with and return > reasonable values.
OK, so I think I've come a little further along. The particular segfault I reported originates in the assumption that there exists at least one screen, i.e. list_size(&rp_screens)>0. This reasonable assumption is not checked, so if there are no screens, add_to_window_list will be called with s=NULL. It takes fairly special circumstances to achieve the combination of all screens removed and a subsequent call to add_to_window_list, it just so happens that this occurred fairly often at startup in my environment. See footnote [1] for a MWE that works for me, YMMW. The interesting part is what causes the screen removal. This happens when the xrandr tool is used to switch framebuffer size in Xvfb. See footnote [2] for debug printout, I added a couple to show that the screen is indeed removed. Note especially that an unknown XEvent of type -90 is received (there seems to be no event with this type defined in the X libraries). Also note the error message from xrandr. At this point I think I'd appreciate some input. Could this be caused by a bug in xrandr or Xvfb rather than ratpoison? Can there be something off with ratpoison's event handling? Am I simply using the xrandr tool wrong? If I exchange "--fb" for "--output screen --mode", it no longer causes ratpoison to remove its only screen. [1]: MWE Xvfb :81 -screen 0 5000x5000x24 & export DISPLAY=:81 ./src/ratpoison & sleep 1 ratpoison -c "set padding 0 0 0 0" xrandr --newmode 1600x900 0 1600 0 0 0 900 0 0 0 xrandr --addmode screen 1600x900 xrandr --fb 1600x900 --dpi 130 # Part of the output is in [2]. ratpoison -c "set padding 0 0 0 0" & jobs # Notice that the last ratpoison command doesn't exit. fg 1 # Kill ratpoison with Ctrl-C. jobs # Notice that the command sender still hasn't finished. ./src/ratpoison # This one segfaults [2]: Debug output from ratpoison (in bg) and xrandr root@c2985fd5e2f1:~/ratpoison# xrandr --fb 1600x900 --dpi 130 xrandr: Failed to get size of gamma for output screen xrandr: specified screen 1600x900 not large enough for output screen (5000x5000+0+0) ratpoison:xrandr.c:245: debug: --- Handling RRNotify --- ratpoison:xrandr.c:255: debug: --- XRRCrtcChangeNotifyEvent --- ratpoison:events.c:881: debug: --- Unknown event -90 --- X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) Value in failed request: 0x0 Serial number of failed request: 22 Current serial number in output stream: 22 ratpoison:xrandr.c:245: debug: --- Handling RRNotify --- ratpoison:xrandr.c:250: debug: --- XRROutputChangeNotifyEvent --- ratpoison:globals.c:535: debug: ========== Size of rp_screens: 1 ratpoison:xrandr.c:180: debug: xrandr_output_change: Removing screen screen ratpoison:number.c:125: debug: ns=0x556e8885ae90 release 0 ratpoison:number.c:125: debug: ns=0x556e8885afb0 release 0 ratpoison:globals.c:535: debug: ========== Size of rp_screens: 0 ratpoison:events.c:881: debug: --- Unknown event -90 --- [the rest redacted] _______________________________________________ Ratpoison-devel mailing list Ratpoison-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/ratpoison-devel