ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] Segfault on zero screens (Was: Segfault and faulty focus)


From: Martin Samuelsson
Subject: [RP] Segfault on zero screens (Was: Segfault and faulty focus)
Date: Sat, 20 Jul 2019 10:55:33 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Axel Svensson @ 2019-07-20 (Saturday), 01:20 (+0200)

The particular segfault I reported originates in the assumption that there exists at least one screen

Ah! That's it! A reasonable expectation prior to xrandr, but having zero screens is fully allowed (although arguably useless) with xrandr support.

See footnote [1] for a MWE that works for me, YMMW.

Once you explained the issue, I managed to reproduce with a normal Xorg process merely having launched an xterm and the following commands on a text mode console:

export DISPLAY=:0
for S in `xrandr --listmonitors|sed --silent 's/ [0-9]*:.* //p'`
do
 xrandr --output ${S} --off
done
./src/ratpoison # This one segfaults

The interesting part is what causes the screen removal.

Makes sense. During reconfiguration there's a split second where no screen actually exist and ratpoison should cope with that.

Also note the error message from xrandr.

Without fully understanding them, I wouldn't be surprised if even the tools for xrandr itself gets confused when there are zero screens.

At this point I think I'd appreciate some input.

For most of its life ratpoison knew nothing about xrandr and support for it was only added "somewhat recently". The code needs to be gone through to see which other functions have this assumption on an existing screen.

I quickly tried adding a few null checks and successfully started ratpoison with zero screens, reactivated my screen, launched an xlogo and the new window did appear. My interpretation of that little exercise is that fixing the bug should be very doable.

Unfortunately I don't know the code well enough to immediately understand whether adding all the needed null checks before each use of screens are the way to go, or if there could be a smarter way. Won't have more time to look at it right now, I'm afraid since my weekend is fully booked.

Am I simply using the xrandr tool wrong?

Nah. I'd say you're using it right and found a proper bug in ratpoison. Yet if you manage to find a workaround to setup your environment in some way which doesn't triggering the bug, go for it! Just beware that every time you deploy a workaround you increase your technical debt.
--
/Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]