FS#66482 - [sway] Blank Screen Crash

Attached to Project: Community Packages
Opened by Harry Austen (harryausten) - Thursday, 30 April 2020, 19:07 GMT
Last edited by freswa (frederik) - Saturday, 02 May 2020, 17:06 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jerome Leclanche (Adys)
Brett Cornwall (ainola)
Maxim Baz (maximbaz)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The latest 'sway' package update (1:1.4-9) is broken on my hardware. As soon as I execute the sway binary, I get a blank grey screen with a frozen cursor. My system completely locks up and I can't even back out to a tty (with Ctl+Alt+F#).

Looking at the changelog it looks like it was just rebuilt with a newer json-c library. If I downgrade the 'sway' package to version 1:1.4-8 and extract the previous 'json-c' shared object and symlinks to a directory, e.g. ~/.local/lib, sway runs fine with 'LD_LIBRARY_PATH=~/.local/lib sway', so it appears to either be an issue with the new library (either the library itself, or how it interacts with sway) or a dodgy build.

Additional info:
* package versions
sway '1:1.4-8' -> '1:1.4-9'
json-c '0.13.1-3' -> '0.14-1'
* config and/or log files etc.
lshw.txt attached - output of 'sudo lshw'
display.jpg attached - camera photo of frozen display

I tried to redirect the output of sway to a file, but it seemed to crash before flushing the file, so the file was empty.
This task depends upon

Closed by  freswa (frederik)
Saturday, 02 May 2020, 17:06 GMT
Reason for closing:  Fixed
Comment by Maxim Baz (maximbaz) - Thursday, 30 April 2020, 21:02 GMT
Hi! Thanks for reporting.

I doubt the problem is in the build (as everyone would be affected), but maybe you could verify this by building the package yourself using `extra-x86_64-build` from `devtools` package?

Just a hunch, but is it possible that you have some sort of driver for your hardware that you installed from AUR, that needs to be rebuilt against the new `jcon-c` release? I have a small script packaged as `rebuild-detector` on AUR, it's definitely not conclusive but see if it can maybe give you some extra hints if manual inspection fails.
Comment by ephase (ephase) - Friday, 01 May 2020, 00:25 GMT
Hi,

I've got the exact same problem with sway as json-c with a similar hardware (Ryzen 3 3600, MSI B450 Mortar, AMD Navi GPU - RX5700XT). I tried to downgrade Mesa but same occurs. No driver is installed from AUR.
Comment by Harry Austen (harryausten) - Friday, 01 May 2020, 13:41 GMT
Hi again.

I tried to build the package as per your suggestion. Please forgive me if I did anything wrong, as I have not had much experience with the Arch Build System tools. I ran the following:

asp checkout sway
cd sway/trunk
extra-x86_64-build |& tee ../build.txt

It appeared to build fine. It exited with 'ERROR: The built package (sway) is the one in the repo right now!'. Full log attached (build.txt). I assume that means the build is equivalent to the one in the repos then?

I do not believe my AUR packages are the problem. I don't have very many installed (output of 'pacman -Qm' attached - aur.txt) and am fairly certain none of them are drivers. I use the' amdgpu' kernel module as my graphics driver.
Comment by Maxim Baz (maximbaz) - Friday, 01 May 2020, 17:00 GMT
Thanks for confirming guys that it's not an issue with some driver that needs to be rebuilt.

> It appeared to build fine. It exited with 'ERROR: The built package (sway) is the one in the repo right now!'. Full log attached (build.txt). I assume that means the build is equivalent to the one in the repos then?

This check doesn't actually compare packages, and even though it printed an error, a `.zst` file was created in the folder. Just install it using `pacman -U sway*.zst` and see if the issue is still reproducible, just like with the package in repos.

Assuming it is... My only idea is to ask you to try to build sway from latest master (clone the repo and build using commands in the README), and if the issue is reproducible even then, create an issue on sway issue tracker and lets see what the maintainers will say, maybe they will have at least some suggestions on how to debug this. Feel free to tag me in the issue on Github (@maximbaz).
Comment by Harry Austen (harryausten) - Friday, 01 May 2020, 18:06 GMT
Ah okay that makes more sense. Thank you for the clarification.

I tried installing my built package, but the same issue occured. I cloned the latest sway/wlroots master branches and ran the 'meson' build/install commands, but unfortunately once again the issue was still there.

I will open an issue on the GitHub page.

Thank you very much for all your help Maxim :)
Harry
Comment by freswa (frederik) - Saturday, 02 May 2020, 17:06 GMT
Reason for closing given in request: FYI This issue has been solved (see: https://github.com/swaywm/sway/issues/5290). Summary: A flaw in executing the RDRAND instruction on some AMD CPUs with older BIOS firmware caused the json-c library to enter an infinite loop and therefore the display is never updated. The fix I opted for personally was to update my BIOS firmware to fix the RDRAND instruction on my Ryzen 5 3600 CPU. A patch has also been added to the json-c master branch that prevents users with the bug from entering an inifinite loop, by using alternative random number generation techniques.

Loading...