You are viewing a single thread.
View all comments View context

Also fake because zombie processes.

I once spent several angry hours researching zombie processes in a quest to kill them by any means necessary. Ended up rebooting, which was a sort of baby-with-the bath-water solution.

Zombie processes still infuriate me. While I’m not a Rust developer, nor do I particularly care about the language, I’m eagerly watching Redox OS, as it looks like the micro kernel OS with the best chance to make to it useful desktop status. A good micro kernel would address so so many of the worst aspects of Linux.

permalink
report
parent
reply
55 points

Zombie processes are already dead. They aren’t executing, the kernel is just keeping a reference to them so their parent process can check their return code (waitpid).

All processes becomes zombies briefly after they exit, just usually their parents wait on them correctly. If their parents exit without waiting on the child, then the child gets reparented to init, which will wait on it. If the parent stays alive, but doesn’t wait on the child, then it will remain zombied until the parent exits and triggers the reparenting.

Its not really Linux’s fault if processes don’t clean up their children correctly, and I’m 99% sure you can zombie a child on redox given its a POSIX OS.

permalink
report
parent
reply
1 point

I haven’t tried this, but if you just need the parent to call waitpid on the child’s pid then you should be able to do that by attaching to the process via gdb, breaking, and then manually invoking waitpid and continuing.

permalink
report
parent
reply
5 points
*

I think that should do it. I’ll try later today and report back.

Of course, this risks getting into an even worse state, because if the parent later tries to correctly wait for its child, the call will hang.

Edit: Will clean up the orphan/defunct process.

If the parent ever tried to wait, they would either get ECHILD if there are no children, or it would block until a child exited.

Will likely cause follow on issues - reaping someone elses children is generally frowned upon :D.

permalink
report
parent
reply
17 points

Zombie processes are hilarious. They are the unkillable package delivery person of the Linux system. They have some data that must be delivered before they can die. Before they are allowed to die.

Sometimes just listening to them is all they want. (Strace or redirect their output anywhere.)

Sometimes, the whole village has to burn. (Reboot)

permalink
report
parent
reply
13 points
*

Performance is the major flaw with microkernels that have prevented the half-dozen or more serious attempts at this to succeed.

Incurring context switching for low-level operations is just too slow.

An alternative might be a safe/provable language for kernel and drivers where the compiler can guarantee properties of kernel modules instead of requiring hardware guarantees, and it ends up in one address space/protection boundary. But then the compiler (and its output) becomes a trusted component.

permalink
report
parent
reply
4 points

Thank you. Came here to say this. Microkernels are great for limited scope devices like microcontrollers but really suffer in general computing.

permalink
report
parent
reply
0 points

Quite opposite. Most firmware microcontrollers run is giant kernel. Some microcontrollers don’t even have context switching at all. And I’m not even starting to talk about MMU.

permalink
report
parent
reply
1 point

where the compiler can guarantee properties of kernel modules instead of requiring hardware guarantees

Then you would need to move compiler to kernel. Well, there is one: BPF(and derivatives). It’s turing-incomplete by design.

permalink
report
parent
reply
8 points

RedoxOS would likely never become feature complete enough to be a stable, useful and daily-drivable OS. It’s currently a hobbyist OS that is mainly used as a testbed for OS programming in Rust.

If the RedoxOs devs could port the Cosmic DE, they’d become one of the best Toy OS and maybe become used on some serious projects . This could give them enough funds to become a viable OS used by megacorps on infrastructures where security is critical and it may lead it to develop into a truly daily drivable OS.

permalink
report
parent
reply
9 points

I believe the next step after that would be to wake up

permalink
report
parent
reply
4 points

Hey, we can always dream!

permalink
report
parent
reply
1 point

They have already ported apps from Cosmic though.

permalink
report
parent
reply
3 points

They are planning to port Cosmic DE, and have already ported several applications from Cosmic including the file manager and text editor if I remember correctly.

permalink
report
parent
reply
2 points
*

They’ve shown the COSMIC terminal working on their last showcase video

permalink
report
parent
reply
2 points

HURD 2, the return of rust

permalink
report
parent
reply
4 points

What does this have to do with Rust? Or redox, or micro kernels or Linux?

permalink
report
parent
reply

Zombies are usually tied to some resource use. In microkernels, you have more control over the resources.

permalink
report
parent
reply
3 points

I don’t think a microkernel will help with zombies.

permalink
report
parent
reply
1 point

Ok, how change of kernel would fix userspace program not reading return value? And if you just want to use microkernel, then use either HURD or whatever DragonflyBSD uses.

But generally microkernels are not solution to problems most people claim they would solve, especially in post-meltdown era.

permalink
report
parent
reply

This particular issue could be solved in most cases in a monolithic kernel. That it isn’t, is by design. But it’s a terrible design decision, because it can lead to situations where (for example) a zombie process locks a mount point and prevents unmounting because the kernel insists it’s still in use by the zombie process. Which the kernel provides no mechanism for terminating.

It is provable via experiment in Linux by use of fuse filesystems. Create a program that is guaranteed to become a zombie. Run it within a filesystem mounted by an in-kernel module, like a remote nfs mount. You now have a permanently mounted NFS mount point. Now, use mount something using fuse, say a WebDAV remote point. Run the same zombie process there. Again, the mount point is unmountable. Now, kill the fuse process itself. The mount point will be unmounted and disappear.

This is exactly how microkernels work. Every module is killable, crashable, upgradable - all without forcing a reboot or affecting any processes not using the module. And in a well-designed microkernel, even processes using the module can in many cases continue functioning as if the restarted kernel module never changed.

Fuse is really close to the capabilities of microkernels, except it’s only filesystems. In a microkernel, nearly everything is like fuse. A linux kernel compiled such that everything is a loadable module, and not hard linked into the kernel, is close to a microkernel, except without the benefits of actually being a microkernel.

Microkernels are better. Popularity does not prove superiority, except in the metric of popularity.

permalink
report
parent
reply
2 points
*

This particular issue could be solved in most cases in a monolithic kernel. That it isn’t, is by design.

It was(see CLONE_DETATCHED here) and is(source)

Create a program that is guaranteed to become a zombie. Run it within a filesystem mounted by an in-kernel module, like a remote nfs mount. You now have a permanently mounted NFS mount point.

Ok, this is not really good implementation. I’m not sure that standard requires zombie processes to keep mountpoints(unless its executable is located in that fs) untill return value is read. Unless there is call to get CWD of another process. Oh, wait. Can’t ptrace issue syscall on behalf of zombie process or like that? Or use vfs of that process? If so, then it makes sense to keep mountpoint.

Every module is killable, crashable, upgradable - all without forcing a reboot or affecting any processes not using the module.

except without the benefits of actually being a microkernel.

Except Linux does it too. If graphics module crashes, I still can SSH into system. And when I developed driver for RK3328 TRNG, it crashed a lot. Replaced it without reboot.

Microkernels are better. Popularity does not prove superiority, except in the metric of popularity.

As I said, we live in post-meltdown world. Microkernels are MUCH slower.

permalink
report
parent
reply
1 point

But generally microkernels are not solution to problems most people claim they would solve, especially in post-meltdown era.

Can you elaborate? I am not an OS design expert, and I thought microkernels had some advantages.

permalink
report
parent
reply
2 points

Can you elaborate? I am not an OS design expert, and I thought microkernels had some advantages.

Many people think that microcernels are only way to run one program on multiple machines without modyfing them. Counterexample to such statement is Plan 9, which had such capability with monolithic kernel.

permalink
report
parent
reply
0 points

nah, you can have micro-kernel features on linux, but you can’t have monolithc kernel features on microkernel, there’s zero arguments in favor of a micro kernel, except being a novel project

permalink
report
parent
reply

ORLY.

Do explain how you can have micro kernel features on Linux. Explain, please, how I can kill the filesystem module and restart it when it bugs out, and how I can prevent hard kernel crashes when a bug in a kernel module causes a lock-up. I’m really interested in hearing how I can upgrade a kernel module with a patch without forcing a reboot; that’d really help on Arch, where minor, patch-level kernel updates force reboots multiple times a week (without locking me into an -lts kernel that isn’t getting security patches).

I’d love to hear how monolithic kernels have solved these.

permalink
report
parent
reply
3 points

I’ve been hoping that we can sneak more and more things into userspace on Linux. Then, one day, Linus will wake up and discover he’s accidentally made a microkernel.

permalink
report
parent
reply
2 points

I thought the point of lts kernels is they still get patches despite being old.

Other than that though you’re right on the money. I think they don’t know what the characteristics of a microkernel are. I think they mean that a microkernel can’t have all the features of a monolithic kernel, what they fail to realise is that might actually be a good thing.

permalink
report
parent
reply
1 point

you don’t need a micro kernel to install medules, nor to make a crash in certain module don’t bring the kernel down, you program it isolated, they don’t do that now because it’s unecessary, but android do that, and there’s work being doing in that way https://www.phoronix.com/news/Ubuntu-Rust-Scheduler-Micro

the thing is that it’s harder todo that, that’s why no one does, but not impossible, you also need to give the kernel the foundation to support that

permalink
report
parent
reply

linuxmemes

!linuxmemes@lemmy.world

Create post

Hint: :q!


Sister communities:

Community rules (click to expand)

1. Follow the site-wide rules
2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of β€œpeasantry” to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
4. No recent reposts
  • Everybody uses Arch btw, can’t quit Vim, and wants to interject for a moment. You can stop now.

Please report posts and comments that break these rules!

Community stats

  • 6.7K

    Monthly active users

  • 1.3K

    Posts

  • 69K

    Comments