686
Closing programs (infosec.pub)
top 50 comments
sorted by: hot top controversial new old
[-] Scoopta@programming.dev 231 points 4 weeks ago* (last edited 4 weeks ago)

Ironically it's actually the opposite. Linux has signals, and with the exception of SIGKILL and I think SIGABRT they can all be handled gracefully. Windows on the other hand doesn't have signals, it can only TerminateProcess() which is forceful. The illusion of graceful termination on windows is done by sending a Window close message to all of the windows belonging to a given process, however in the event the process has no windows, only forceful termination is available due to the lack of a real mechanism to gracefully terminate processes. That's why the taskkill command tells you a process requires forceful termination when you run it against something headless.

[-] mkwt@lemmy.world 96 points 4 weeks ago

Windows does, in fact, have signals. They're just not all the same as Unix signals, and the behavior is different. Here's a write-up.

You're correct there is no "please terminate but you don't have to" signal in Windows. Windowless processes sometimes make up their own nonstandard events to implement the functionality. As you mentioned, windowed processes have WM_CLOSE.

Memory access violations (akin to SIGSEGV), and other system exceptions can be handled through Structured Exception Handling.

[-] Scoopta@programming.dev 12 points 4 weeks ago

TIL about the console signaling stuff, good to know. I am aware of SEH but that seemed a little too in the weeds for this discussion since that's as you say akin to SIGSEGV

[-] marcos@lemmy.world 14 points 4 weeks ago

The NT kernel was all built to emulate object orientation (read Smalltalk, not C++) style message passing. That's because it was the 90s, and it's the new technology kernel.

So yeah, expect everything to have more flexibility sending data around, and no standardization at all so you can't have any generic functionality.

[-] Feyd@programming.dev 66 points 4 weeks ago* (last edited 4 weeks ago)

You're right about Linux but you're wrong about windows. It is sent to the event loop in windows https://learn.microsoft.com/en-us/windows/win32/winmsg/window-notifications. It's been a long time since it was my job, but you actually had to pass a certification that your application exited gracefully in response to these messages as part of the partner program back in the day.

load more comments (5 replies)
[-] Rhaedas@fedia.io 12 points 4 weeks ago

It also means the OS is in total control of the things it's running. This goes for running programs, shutting down, and crashing. The only crashes I have on my Linux are when I use up memory, and I'm still convinced that even though everything looks seized up, if I left it for hours or days it would probably end up resolving itself. I've had some cases where the OS saw the program wasn't going in a good direction fast enough and killed it.

load more comments (1 replies)
[-] 30p87@feddit.org 10 points 4 weeks ago

That's fucked up

[-] RickyRigatoni@retrolemmy.com 9 points 4 weeks ago
load more comments (1 replies)
[-] cows_are_underrated@feddit.org 116 points 3 weeks ago* (last edited 3 weeks ago)

While the meme is very funny, it is technically incorrect. Linux has two major ways of terminating a process. When Linux wants a process to terminate execution (for whatever reason) it first sends the SIGTERM signal to the process, which basically "asks" the process to terminate itself. This has the advantage, that the process gets the chance to save its state in a way, that the execution can continue at another time. If the process however ignores the SIGTERM signal at some point Linux will instead forcefully terminate the execution using the SIGKILL signal. This represents what the image shows.

Before someone gets mat at me: I know, that there are like 50 more Signals relevant to this, but wanted to keep it simple.

[-] Rubanski@discuss.tchncs.de 23 points 3 weeks ago

Does the "SIG" stands for "Signal"?

[-] SuspciousCarrot78@lemmy.world 21 points 3 weeks ago

I like to secretly imagine it stands for SIG SAUER. Bang = process ded

load more comments (3 replies)
[-] mrunicornman@lemmy.world 19 points 3 weeks ago

Special Interest Group. An internal committee convenes to decide the fate of the process.

(I don't know the answer, but I'm pretty sure it stands for signal.)

load more comments (1 replies)
load more comments (1 replies)
[-] Lemminary@lemmy.world 17 points 3 weeks ago

Simple answer for us simple folk. I like it. Thank you!

[-] FosterMolasses@leminal.space 10 points 3 weeks ago

While the meme is very funny, it is technically incorrect.

The worst kind of incorrect!

load more comments (3 replies)
[-] jet@hackertalks.com 86 points 4 weeks ago

Graceful like closing a laptop and putting it in a backpack only to have windows refuse to shutdown and become a heater until it cooks the battery and ruins the screen....

load more comments (18 replies)
[-] thenextguy@lemmy.world 77 points 4 weeks ago

This meme gets crustier and crustier every time I see it. It’s amazing after all these years people still post this.

load more comments (3 replies)
[-] NeatNit@discuss.tchncs.de 75 points 3 weeks ago

Stop spreading this lie. Linux has a more graceful shutdown process than Windows ever did. It doesn't abruptly kill everything.

[-] Bazell@lemmy.zip 22 points 3 weeks ago

Unless you told him to do so. 🙃

load more comments (1 replies)
load more comments (3 replies)
[-] Shanmugha@lemmy.world 60 points 3 weeks ago

Windows:

  • program refuses to shutdown
  • system: okay, guess you don't need your computer to turn off anyway
[-] rustydrd@sh.itjust.works 19 points 3 weeks ago

Such grace.

[-] JelleWho@lemmy.world 14 points 3 weeks ago

There is a windows registry hack to set the shutdown wait time for 1s and that did fix it for me. But every update they turn it back to unlimited.

(I ended up installing Linux, I only have the dnf5daemon server holding the shutdown up for atnost 5min now. But I haven't tried to fix it)

[-] Shanmugha@lemmy.world 15 points 3 weeks ago

Which is why in my Windows days I got a habit of turning computer off with Windows + R --> shutdown -s -f -t 0

Windows just works, my ass :)

[-] vogi@piefed.social 55 points 4 weeks ago

Isn't that what SIGTERM is? A request to gracefully shutdown processes.

[-] 9point6@lemmy.world 25 points 4 weeks ago

kill, and I swear to god if you're still there when I ps, I'm getting out the -9

[-] 69420@lemmy.world 17 points 4 weeks ago
alias murder="kill -9"
[-] marcos@lemmy.world 9 points 4 weeks ago

Yeah, by default kill sends sigterm, and not kill the process at all.

It's the correct behavior, sending sigkill by default would be harmful. Now take a look at how killall worked in Solaris (before it adopted GNU).

load more comments (3 replies)
[-] pewpew@feddit.it 13 points 4 weeks ago

Systemd waits until the services terminate before shutting down

[-] andyburke@fedia.io 10 points 4 weeks ago
load more comments (4 replies)
[-] Rolive@discuss.tchncs.de 50 points 3 weeks ago

Windows task manager:

Let's play a whack a mole game where the app you're trying to kill constantly moves up and down a list by default! Enjoy!

[-] egrets@lemmy.world 30 points 3 weeks ago

There's a non-obvious freeze function in the Task Manager - for as long as you hold the Ctrl key, it'll stop updating the list. I have no idea why this functionality is hidden, but I guess Dave Plummer had some unusual ideas about UX.

load more comments (1 replies)
[-] Dupelet@piefed.social 40 points 4 weeks ago

Windows: If you can't exit gracefully, I'll make sure you never exit at all

[-] muusemuuse@sh.itjust.works 11 points 4 weeks ago

Oh dear, my toe seems to have found the switch on my surge protector. I win.

load more comments (2 replies)
[-] mvirts@lemmy.world 38 points 3 weeks ago

Lol as we've discussed before, inaccurate but funny.

load more comments (2 replies)
[-] Taleya@aussie.zone 34 points 3 weeks ago

Windows treats user commands like most tech treats consent. Negotiable, ignorable.

Linux brooks no bullshit. The program will do as it is told.

[-] CameronDev@programming.dev 10 points 3 weeks ago

That isn't exclusively true. Programs can capture SIGTERM and ignore it, or do as they please, SIGKILL is non-negotiable though.

Windows does have an equivalent to SIGKILL as well, in taskkill /F.

load more comments (5 replies)
[-] KeenFlame@feddit.nu 29 points 3 weeks ago

Oh sweet summer children.. its worse. Linux tells the program to kill itself, then makes sure it happens

[-] 1984@lemmy.today 27 points 3 weeks ago* (last edited 3 weeks ago)

I mean, also look at how windows installs programs. Its like a 100 step process taking several minutes, because just putting the files where they need to be is just too simple.

Or the uninstall program, cant just remove the files, no... Need to run full installer backwards to remove all the registry entries and even reboot the system to get rid of it all.

[-] victorz@lemmy.world 13 points 3 weeks ago

One of the actual (many) reasons that drove me from Windows. Over the years it became so dirty to have so many old files and registry entries that were abandoned by their respective uninstallers that I became wary of installing anything at all, and that's not the feeling I want with my personal computer.

load more comments (10 replies)
[-] copacetic@discuss.tchncs.de 21 points 3 weeks ago

Android/iOS users: What is “closing“? What is a „program“?

load more comments (2 replies)
[-] CanadaPlus@lemmy.sdf.org 15 points 3 weeks ago* (last edited 3 weeks ago)

From what I've heard about Windows, it works more like the Simpsons "Barney coming up behind Moe" meme.

So, as it should be, Tux.

[-] Zamboni_Driver@lemmy.ca 15 points 3 weeks ago

I get it windows is evil and bloated, blah blah blah.

But to hear some of you describe the problems that you have using windows makes me think that you're as incompetent as my grandmother.

load more comments (1 replies)
[-] MehBlah@lemmy.world 9 points 4 weeks ago

Yup. Sometimes you like to fire a few shots manually just for fun.

load more comments (7 replies)
load more comments
view more: next ›
this post was submitted on 15 Jan 2026
686 points (88.6% liked)

Programmer Humor

29672 readers
1236 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