Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    +1 Thanks! 1. Could you please provide reference links? 2. Is the heap copied entirely, or in parts? Commented Aug 20, 2014 at 15:19
  • 4
    2. - In pages :) The kernel has very little understanding of what "heap" is - for the kernel, it's just a bunch of mmapped private pages, that the libc allocators handle as it please. Commented Aug 20, 2014 at 15:21
  • Is this really a fork-bomb necessarily? It seems to me that rather than forking the current process, this code will create more instances of the same program that execute from start rather than from the next instruction after the fork() call. Commented Oct 20, 2014 at 12:55
  • @mmk FYI, I was quite surprised by your "Interesting side-note:" and so I tested (on Linux 3.2.0) to see, and it does not appear to be true. I used /proc/self/pagemap to determine the virtual address to physical page mapping for the purposed of the test. As I expected, if the grand-child and only the grand-child writes the shared page, then the parent and original child continue to share it. Only the grand-child ends up with a private copy. Commented Nov 13, 2014 at 17:41
  • @Celada. Hmm. I had read this somewhere, and I don't remember the kernel version it was referring to (probably an older one?), so, it may no longer be valid. Commented Nov 14, 2014 at 1:23