this post was submitted on 25 Dec 2024
409 points (99.0% liked)

Programmer Humor

20215 readers
1798 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 1 month ago (2 children)

My computer has a problem where occasionally it will become completely unresponsive. (Mouse cursor doesn't move. Keys have no apparently effect. Whatever app is running freezes. I think its a hardware problem with the graphics card, but I don't know what. Logs at the time it freezes say "the GPU has fallen off the bus".)

Anyway... I recently learnt about Magic SysRq. And I've been able to shutdown the computer from this unresponsive state with SysRq, R E I S U O. Where as I understand it, the "E" tells processes the end nicely if they can; and then the "I" just ends them by force.

(At this point, I'm realising that the E is SIGTERM, not SIGINT - so that screws up the relevance of my story; but I figure I'll keep going anyway.)

The point is, I've been using key combo with a nice pause between each key, thinking there was some chance that processes might be ending gracefully. But when I tried it while the computer wasn't frozen, the computer was able to inform me that the E and I commands were disabled. (I don't know why.) So even though I wanted to give a nice "please end" signal, in the end that just wasn't happening.

[–] [email protected] 3 points 1 month ago (1 children)

You could try enabling systemd-oomd. It's a userspace OOM killer and seems to be aggressive enough to mostly stop that from happening.

[–] [email protected] 1 points 1 month ago (1 children)

I'm not sure what you mean. Stop my computer from hanging like that? Or make it so that SIGTERM and SIGKILL work with those magic keys? I don't know what an OOM killer is.

I'd definitely be interested in something that stopped the computer from crashing. But I kind of doubt that's going to happen; because as I said, I'm pretty sure it's a hardware thing. (But I suppose appropriate software might allow it to successful recover from the problem without having to restart.) It's pretty rare by the way. I use the computer almost every day, and I haven't had this problem happen for a few weeks. I've basically given up trying to fix it.

[–] [email protected] 2 points 1 month ago (1 children)

Yeah the hanging is being caused by your RAM being filled. Systemd-oomd will kill things more aggressively than the kernel out-of-memory handler that should stop it from locking up.

[–] [email protected] 2 points 1 month ago

Alright, then that sounds like its definitely worth trying. Thanks for the suggestion. I guess it will be hard for me to tell whether or not it is working, because in the ideal case: nothing happens. But I'll definitely try it out and hope for the best.

[–] [email protected] 1 points 1 month ago (1 children)

Have you tried other TTYs? When I press Ctrl+Alt+F3, for example, I switch to a ‘real’ terminal that (I assume) doesn’t require the GPU to work. From there you might be able to recover.

On Linux Mint the default, graphical userface is on TTY7 (CTRL+Alt+F7).

[–] [email protected] 2 points 1 month ago

Yes, I have tried that. But it has no apparent effect when the computer is in that frozen state. (i.e. pressing ctrl+alt+F3 or whatever doesn't change what is on the screen.

One time I tried imagining that the terminal came up, and so I 'signed in' and tried to shut down without seeing anything on the screen. But it didn't work. ... but since I couldn't see anything, it's quite possible I just mistyped something. So I guess that's inconclusive.