Bug 1221078

Summary: xorg programs (xset, xterm etc) running as root cause an infinite loop waiting for authentication when XAUTHORITY and XAUTHLOCALHOSTNAME are not set.
Product: [openSUSE] openSUSE Tumbleweed Reporter: X <opensuse>
Component: X.OrgAssignee: Fabian Vogt <fvogt>
Status: RESOLVED FIXED QA Contact: Gfx Bugs <gfx-bugs>
Severity: Minor    
Priority: P5 - None CC: fvogt, gfx-bugs, obs
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description X 2024-03-06 15:23:44 UTC
I noticed a lot of zypper dup sessions hanging at the post scripts stage causing the cpu to spike with the process 'xset fp rehash'. User fvogt on irc helped me troubleshoot the issue which ended up being triggered by my using doas instead of su/sudo. While su/sudo seem to be setting the display/xauth related environment sufficiently, doas did not. 

Testing the working 'su' session by unsetting XAUTHORITY and XAUTHLOCALHOSTNAME causes those sessions to fail exactly the same way as well. When running xset or xterm I get the error message "Authorization required, but no authorization protocol specified" looping indefinetely. The program does not complete or exit with an error, causing the CPU spike mentioned at the beginning. 

I don't know if it makes a difference but I am actually running Wayland (KDE Plasma) not Xorg and have not tested the same parameters on Xorg.
Comment 1 Fabian Vogt 2024-03-06 15:25:21 UTC
https://build.opensuse.org/package/rdiff/X11:XOrg/libxcb?linkrev=base&rev=67 caused a regression by moving the "*stage = 2" assignment inside the if by accident.

Fixed with https://build.opensuse.org/request/show/1155610
Comment 2 Stefan Dirsch 2024-03-06 15:33:31 UTC
Ouch. Shit happens. :-(

Thanks for spotting this, Fabian!
Comment 3 X 2024-03-06 15:36:49 UTC
Fix works for me. Thanks a lot.
Comment 4 Stefan Dirsch 2024-03-06 15:40:26 UTC
*** Bug 1219962 has been marked as a duplicate of this bug. ***