As someone who doesn't understand much of what's going on here, what resources would you suggest I study to improve?
A more pragmatic book is The Linux Programming Interface, by Michael Kerrisk. It is Linux-specific though, but that's probably fine. Uninterruptible process sleep is covered in section 22.3. Threads, in chapters 29–33. Signals, chapters 20–22. The proc file system in section 12.1. Memory mappings, chapters 49–50.
Show HN: A “living” Linux process with no memory
101–110 of 117 posts
Re: Show HN: A “living” Linux process with no memory
#102Earlier quoted context omitted.
The thing about the "money" argument is that one could just as strongly claim that you went to 1st grade "for money".
And at the end, we end up with the capitalists dream: "I was born... for money"
Everything in between made it seem like making money my No. 1 focus was necessary, though. A lifetime of being manipulated and pressured. It all gets better when you can finally pull back the curtain seeing what's really there. :)
Re: Show HN: A “living” Linux process with no memory
#103Earlier quoted context omitted.
Use your OS's own packaging system to install python-fuse. It may already be installed!
The python-fuse package on Ubuntu 18.04 does not seem to work (too old?). $ python2 fs.py x Traceback (most recent call last): File "fs.py", line 8, in class fs(fuse.Operations): AttributeError: 'module' object has no attribute 'Operations' $ python2 Python 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import fuse >>> fuse.__ver…
from fuse import fuseRe: Show HN: A “living” Linux process with no memory
#104Excerpt:
"There are advantages and disadvantages to each type of sleep. Interruptible sleeps enable faster response to signals, but they make the programming harder. Kernel code which uses interruptible sleeps must always check to see whether it woke up as a result of a signal, and, if so, clean up whatever it was doing and return -EINTR back to user space.
The user-space side, too, must realize that a system call was interrupted and respond accordingly; not all user-space programmers are known for their diligence in this regard.
Making a sleep uninterruptible eliminates these problems, but at the cost of being, well, uninterruptible. If the expected wakeup event does not materialize, the process will wait forever and there is usually nothing that anybody can do about it short of rebooting the system.
This is the source of the dreaded, unkillable process which is shown to be in the "D" state by ps.
Given the highly obnoxious nature of unkillable processes, one would think that interruptible sleeps should be used whenever possible. The problem with that idea is that, in many cases, the introduction of interruptible sleeps is likely to lead to application bugs.
As recently noted by Alan Cox:
Unix tradition (and thus almost all applications) believe file store writes to be non signal interruptible. It would not be safe or practical to change that guarantee."
That's the whyness to all of this...
Re: Show HN: A “living” Linux process with no memory
#105Earlier quoted context omitted.
The python-fuse package on Ubuntu 18.04 does not seem to work (too old?). $ python2 fs.py x Traceback (most recent call last): File "fs.py", line 8, in class fs(fuse.Operations): AttributeError: 'module' object has no attribute 'Operations' $ python2 Python 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import fuse >>> fuse.__ver…
You probably have to change the import to something like from fuse import fuse
Re: Show HN: A “living” Linux process with no memory
#106I've now seen a similar case multiple times in the wild - if a process has a thread in uninterruptible sleep (e.g., blocked on a bad disk or a stuck network filesystem) and you kill it, the process dies, but the kernel waits forever for that thread before informing the parent process. The parent doesn't get SIGCHLD, and wait() doesn't return. (So, for example, your favorite init/supervisor won't restart the process o…
For anyone who was wondering, I found a post explaining why threads can be in "uninterruptible sleep" in the first place: https://eklitzke.org/uninterruptible-sleep
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/dd...
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/ke...
Re: Show HN: A “living” Linux process with no memory
#107https://lwn.net/Articles/288056/ Excerpt: "There are advantages and disadvantages to each type of sleep. Interruptible sleeps enable faster response to signals, but they make the programming harder. Kernel code which uses interruptible sleeps must always check to see whether it woke up as a result of a signal, and, if so, clean up whatever it was doing and return -EINTR back to user space. The user-space side, too, m…
> If the process is in uninterruptible sleep then the process can’t be interrupted, which will cause the strace process itself to hang forever. Remarkably, it appears that the ptrace(2) system call is itself uninterruptible, which means that if this happens you may not be able to kill the strace process!
Everything about this is broken and makes no sense. The Night Watch is as relevant as ever. (https://www.usenix.org/system/files/1311_05-08_mickens.pdf)
Re: Show HN: A “living” Linux process with no memory
#108Earlier quoted context omitted.
I've had projects that - eventually and incidentally - brought me money, but were not started or done for money.
The thing about the "money" argument is that one could just as strongly claim that you went to 1st grade "for money".
In other words : you can't derive a motivation from an action an individual does if it's something that they're forced to do so socially or legally.
Re: Show HN: A “living” Linux process with no memory
#109Re: Show HN: A “living” Linux process with no memory
#110It's 2020. You couldn't have done this in Python3?