8 ms·
DRM Panic QR code generator
- danhor 1y agoIt seems like this is already deployed in Arch, as I've hit it yesterday. I was surprised at first, but it was quite useful.
- homebrewer 1y agoIt's easy to check (unless the kernel was compiled without config in procfs, which it probably wasn't): $ zgrep CONFIG_DRM_PANIC_SCREEN_QR_CODE /proc/config.gz CONFIG_DRM_PANIC_SCREEN_QR_CODE=y
- kokada 1y agoThanks, also seems enabled by default in NixOS.
- sudobash1 1y agoThere are mainstream distros that don't have config.gz. Fedora is one of them. But it keeps a copy of it's config next to the kernel. If you don't have /proc/config.gz try this: grep CONFIG_DRM_PANIC_SCREEN_QR_CODE /boot/config-$(uname -r) (Fedora is enabling the DRM panic screen QR code)
- greatgib 1y agoFun, and nice addition, but again another good example of let's sneak some rust in critical parts of the kernel so that rust will become mandatory. I would not really have noticed if there wasn't this section about why rust, where arguments looks phony and clearly made up afterward to justify a decision that was already taken: This project was written in rust, because memory safety is critical in a panic handler. For this particular case, I found the Rust code to be cleaner, and easier to read.
- kookamamie 1y agoAgreed, picking Rust for the project likely has very little to do with "memory safety".
- rcxdude 1y agoI suspect it's more of a 'this would be handy to have, and I would prefer to use rust' as opposed to motivated by making the language harder to do without in the kernel. Certainly this kind of thing I would find rust much nicer for than C. (I would agree the first argument is kinda wavy. If anything the panic handler has a fairly unique relationship with memory safety: it's likely to be executing in an environment where that's already gone out the window and it needs to try to assume as little as possible about what might or might not be correct that its reading from and writing to, while also its own memory safety is perhaps less critical because the system is already crashing, it's just got to get the info out before everything completely stops. Though that doesn't make it immune from security concerns. A code execution vulnerability in the handler means any panic could turn into a worse problem)
- tialaramex 1y agoThe elaborate Rust type system and so on does not exist in the machine code executing when "the system is already crashing". Very often it turns out that expressive Rust you wrote which talks about a fancy Iterator protocol and a lambda function just got compiled into the same sixteen CPU instructions that would have been emitted for the (much harder to understand) macro expanded C you'd have to write instead with the same meaning. Rust vs C matters a lot more for maintainers, who read the source code - hopefully not from a machine which is currently crashing - than for the executable kernel itself.
- rcxdude 1y agoI'm aware, whuch means that e.g. you're liekly already in undefined behaviour land and rust's safety guarantees are no longer, well, guaranteed.
- jeroenhd 1y ago
- Am4TIfIsER0ppos 1y agoHow am I supposed to use a QR code when the only thing that I have to decode it is currently panicking? If I am supposed to draw it I hope it is only a few bits. A traditional BSOD with codes and registers would be easier to copy.
- bauruine 1y agoIt may isn't useful for you but a huge majority has a phone they can use for this task.
- elmigranto 1y agoWhat if your phone’s kernel panics? :)
- tialaramex 1y agoDid you know other people have phones too?
- andrelaszlo 1y agoBring out the crayons and some graph paper!
- ChocolateGod 1y agoThat's planned obsolescence and you should get a new one.
- preisschild 1y agoGet your second phone, duh :)
- deleted 1y ago[deleted]
- weinzierl 1y agoIn this context DRM stands for Direct Rendering Manager. It has nothing to do with digital rights management.
- deleted 1y ago[deleted]
- userbinator 1y agoDo not want. More dumbing down and opaqueing? This is as stupid as what happened to Windows' BSoDs.
- preisschild 1y agoHave you even read what it does in the link? How is it "dumbing down and opaqueing" to just encode the kernel panic in a QR code? Its not like in windows where you get some cryptic error code. This is just encoding kernel panic traces as a QR code, so more can fit on the screen without scrolling and copying is easy.
- userbinator 1y agoand copying is easy It's always easier to read and share text, e.g. over the phone, and not have to rely on another complex layer of obscurity --- especially when you're trying to figure out what happened.
- ranger207 1y agoI think a QR code is easier for most people to share in a computer-readable format. You take a picture on your phone and either decode the QR code on your phone or send the picture to another computer and decode it there. The alternative is taking a picture on your phone of a screen of text, and either manually typing out what it says or using OCR, which (given pictures I've seen where people take pictures of their screen) is going to run into difficulties
- kokada 1y agoThat is even assuming that the TTY has the correct resolution for your monitor, that is not always the case. If not, it is highly likely that the most important information will be missing, it happened for me quite a few times. Of course, it doesn't mean that the QR code could also not be cut off the screen, but since QR code is more dense in information (like the post says), I think this is more rare.
- 1y ago
- jcalvinowens 1y agoThis is awesome. I can't tell you how many times in my life I've been sent a photo of a Linux panic bracktrace with the first half missing because the screen couldn't display enough lines... Funny story: on an x86 motherboard with no serial, I recently resorted to using an old 4K monitor with the 4x6 tiny console font to catch a panic (that netconsole wouldn't log for some reason).
- sudobash1 1y agoI am disappointed to see that the QR code is completely replacing the panic messages. There is plenty of room on most monitors to have a stack trace on one side and the QR code on the other. I probably won't be enabling this on my machines, but good on them for trying to improve on the Linux panic screen.