![]() | This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
![]() | The contents of the Wabbit (computing) page were merged into Fork bomb. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
Hi. I'm the one who published the Forkbomb SHELL code :(){ :|:& };: as a work of art in 2002. My artwork used to be quoted in this article, as an example which is still there. A few months ago this reference was deleted and I asked the one who deleted why. Here is the discussion (update! now even the discussion has been deleted!). Anyway, I'm looking forward to read your opinions on art :^) And I hope I won't be removed from this little part of Internet history, that forkbomb was a source of inspiration for this article. ciao jaromil ( talk) 00:17, 28 October 2012 (UTC)
Are you seriously claiming ownership of a simplistic bash command line under the guise of art? Really? 71.92.36.147 ( talk) 07:47, 8 November 2012 (UTC)
Following recent edits, I'd like to thank the editors involved for restoring a whole lot of information that was present on this article and deleted without much discussion. Regarding the "elegant" definition of the :(){ :|:& };: forkbomb, here is the statement of a well known art critic and computational linguist http://runme.org/feature/read/+forkbombsh/+47/ among other awards and reviews. This runme link was what is now a missing reference resulting from the deletion. ciao jaromil ( talk) 13:38, 7 March 2013 (UTC)
Removed wording suggesting Jaromil invented this snippet. It has been shown in numerous sources that this has existed long before he supposedly came up with it. He may have independently came up with it without having knowledge of it prior, but is no reason to credit him as the creator. http://www.oocities.org/f173s/sendmail-8_8_x-8_9_x.txt https://groups.google.com/forum/?hl=en&fromgroups#!topic/muc.lists.bugtraq/CH1RVi3TWZo 65.5.176.229 ( talk) 16:45, 7 March 2013 (UTC)
Who displayed what for whatever is irrelevant to the topic of this page. Citing the bash fork bomb as being displayed as art once upon a time doesn't belong here. I have removed the reference. 75.131.26.156 ( talk) 04:45, 9 March 2013 (UTC)
Beware Wikipedia editors: this page is being targeted by deletionism. The page recent history will show several unsigned interventions aimed at deleting content and omitting historical information. jaromil ( talk) 09:54, 12 April 2013 (UTC)
Removed reference to it being 'art' at some event once more; IT DOESN'T BELONG! Stop adding it. 68.114.46.33 ( talk) —Preceding undated comment added 22:12, 24 June 2013 (UTC)
Please stop edit warring over this sentence! Jaromil, I've reworded the bit about the artwork and added a reference, but dropped your name; if an uninvolved party feels that the name should be included they're welcome to put it back in. IP addresses, I personally believe that the possibility that fork bombs could be regarded as art merits inclusion in the article, but I'm open to other opinions. — Wolfgang42 ( talk) 17:35, 1 July 2013 (UTC)
I think the example should be removed entirely due to the fact that it cannot work as intended in any POSIX-compliant shell, including Bash's POSIX mode. It isn't technically valid shell code, and can only work due to quirks specific to Bash's non-POSIX mode, and in Zsh due to it having the right combination of bugs. I covered the problem in more detail in this article a while ago. Aside from the reserved function name, it isn't the most effective implementation. The `&` is just shooting yourself in the foot because the caller now doesn't need to wait for the subshell functions to return and is free to exit immediately, thus the second function call isn't accomplishing anything other than the net effect of replacing the caller, so this is not exponential growth. Also, the pipeline slows down the calls by making unnecessary system calls to set up the pipe and redirect I/O between processes that never read or write anything. This fork bomb could be "improved" using something like: `f() { f & f; };` or `f() { f & f & wait; };`. Ormaaj ( talk) 09:49, 23 May 2014 (UTC)
I do not think the Java Applet example is a fork bomb: 1) It does not spawn processes. 2) Even if you are liberal and define a "new thread" to count as a "new process", this example's new threads do not spawn new threads themselves, which is the signature "forking" element of the fork bomb. It is my opinion that this example is designed to deny CPU cycles rather than deny process table entries and/or thread handles. I intend to remove this example in a month or so, unless someone can convince me that this code really does represent a fork bomb. - MC ( talk) 05:01, 24 July 2010 (UTC)
Can anyone prevent a fork bomb in windows? If so please put it on the main page —Preceding
unsigned comment added by
79.97.217.123 (
talk)
00:10, 28 November 2008 (UTC)
I got here from
wabbit but this is not explained. Can someone please do so! --
HappyDog 17:12, 31 Jan 2004 (UTC)
Why the "%0|%0" windows example was removed (by Andrew Hampe)? Is it not the most concise example for the windows platform and worth including? -- LKRaider ( talk) 12:41, 10 December 2007 (UTC)
Why do you include two versions in perl? Both of them are in fact the same.
89.77.174.218 (
talk)
09:40, 27 February 2008 (UTC)
Article mentions that bash fork bomb was created by Jaromil in 2002.
I was able to find posts of a polish white hat - lcamtuf from 1999 in usenet, in which he had this fork bomb in his signature.
Necc (
talk)
17:25, 13 March 2008 (UTC)
It doesn't say that he came up with that piece of code. I just remember him having it a long time ago before apparently it was invented :] Here's an example, although you can find it in most of his emails from that period: http://groups.google.co.uk/group/muc.lists.bugtraq/browse_thread/thread/87d51562dd3599a/044c5404a9860dd4 Necc ( talk) 20:12, 17 March 2008 (UTC)
The Erlang fork bomb should be removed; the processes created by Erlang are restrained to the virtual machine and only dispatched and load balanced by the VM itself. They're NOT OS level threads. Hitting the limit of Erlang processes will thus only crash the Erlang VM and will not influence anything else. I believe the example should be removed, as it's misleading and doesn't fit the definition. —Preceding unsigned comment added by Mononcqc ( talk • contribs) 16:35, 19 April 2009 (UTC)
I tried it both before and after fork bombing. It just says: -bash: !: event not found
What is actually the '!'? —Preceding unsigned comment added by Ehasl ( talk • contribs) 20:11, 25 April 2008 (UTC)
Getting rid of a forkbomb on Linux systems even if the process table is full is possible.
1. Press Ctrl+Alt+F1. After a while you should see the login: prompt
(if something else is there use Ctrl+Alt+F2 etc until you find one)
2. Login as root. Once again, this might take awhile
3. Issue kill -9 -1. This might take a while again but once it is done, the forkbomb is dead, as is everything else
4. issue init 1 followed by init 5 to restart system services —Preceding
unsigned comment added by
64.139.38.226 (
talk)
23:22, 11 August 2008 (UTC)
Should Wikipedia include what errors, etc. come up during a fork bomb? IE: Windows Command Line in Vista states that "The process tried to write to a nonexistent pipe." This usually occurs late in the fork bomb. 24.183.100.243 ( talk) 02:24, 20 January 2009 (UTC)
Neither it works in Windows 7 also:
C:\Users\Dyr>:s
C:\Users\Dyr>start %0
Не удается найти файл %0.
C:\Users\Dyr>goto :s
C:\Users\Dyr>%0|%0
"%0" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
C:\Users\Dyr>
--
217.119.16.26 (
talk)
12:21, 6 April 2010 (UTC)
claiming Windows is not a real operating system? baka, windows is a very real and very popular OS; anyway, this DOES apply to windows 7, you just need it to run as a .bat file ^^ save %0|%0 in a .bat file, and run it, then open taskmgr.exe .. luckily you can easily "defuse the bomb" by spamming the X button on the batch window ^^ Divinity76 ( talk) 12:45, 5 February 2014 (UTC)
Removed the how-to tag, these are elegant examples that aid description, programming is about instruction it is an unavoidable consequence that this resembles a how to. You would not stigmatise an arts page as how-to because they have a gallery of examples. I agree its got a bit out of hand on this page with the fanboy attitude of adding every language under the sun :S but deciding what languages are significant is another story. MattOates (Ulti) ( talk) 08:04, 3 June 2009 (UTC)
I know that Fork Bombs are relatively harmless since they can be terminated through a log off, or a reboot, but is it really a good thing to produce so many examples of them on this one page. It just seems like any sort of malicious code, virus, or bomb should not be posted in a place like this. 143.112.32.4 ( talk) 20:53, 5 January 2010 (UTC)
i agree what if terrist git this kode and bomb murrica!!!! —Preceding unsigned comment added by 86.42.170.162 ( talk) 19:45, 12 February 2010 (UTC)
Why do you push and pop from the stack? Isn't this better?
section .text
_start:
? —Preceding unsigned comment added by 85.167.25.91 ( talk) 14:51, 2 July 2010 (UTC)
Don't most fork bombs allocate each process memory with Malloc or whatever language specific memory allocation function that language uses? So shouldn't the C/C++ examples malloc themselves, I don't know, 100 MB? Mmavipc ( talk) 05:55, 2 September 2010 (UTC)
The classic ":(){ :|:& };:" bomb doesn't seem to work on newer bash versions anymore - it gives a syntax error. -- 187.15.115.138 ( talk) 18:10, 25 September 2010 (UTC)
:
is not synonymous with true, it is a noop that just happens to return true.
Cdwn (
talk)
02:35, 19 September 2012 (UTC)
man true
. true is a command, which always returns exit code 0 (success). :
is a builtin doing exactly the same.
Nyh (
talk)
21:38, 20 September 2012 (UTC)
true
that you are probably using, as true
is also a shell builtin. Compare strace bash -c :
and strace bash -c true
; they do not perform the same internally. Either way, my intention was only to correct a factual inaccuracy, not engage in pedantry over function vs. form (or the meaning of what it is to be "synonymous"...).
Cdwn (
talk)
14:22, 26 September 2012 (UTC)I tried uploading the full version of the fork-bomb shell script to virustotal.com, and no engines detect it. (A handful of antivirus engines detect the "%0|%0" version.) Why do so few anti-malware apps detect the fork-bomb shell script, and what's the best way to scan a shell script to see if it is malicious or not? Bwrs ( talk) 07:39, 3 April 2021 (UTC)
I removed the M forkbomb, because it was wrong. A real one would look like this:
f f j f
but I think that the whole examples section is OR, so I'm just going to leave it out. 24.177.120.138 ( talk) 07:50, 17 April 2011 (UTC)
And it should probably be referred to as common lisp, rather than just lisp. It can't be made multi-threaded, let alone multi-process, as forking and threading are undefined in the standard. Maybe it should be deleted or changed to an implementation dependent version? —Preceding unsigned comment added by 138.37.91.30 ( talk) 16:14, 26 April 2011 (UTC)
ABAP Version was just an infinite loop and not a fork bomb. Given the fixed number of process slots Netweaver has with a roll-in/roll-out mechanism a forkbomb does not quite make sense - it would not bring the system completely to its knees, it would just drastically degrade performance. I guess a semi fork-bomb can be made using CALL FUNCTION .. IN BACKGROUND TASK. — Preceding unsigned comment added by 41.185.97.170 ( talk) 09:07, 22 September 2011 (UTC)
I will be editing this because it doesn't use any functions or syntax specific to C++, and also it uses the C standard library to actually use the system() function. Also, I have general issues with it: I'm not sure it's a proper fork bomb as it consumes one thread and only one of the processes is using the CPU; all the others appear to be idle. None daemonise from the calling shell. -- Adamd1008 ( talk) 18:14, 7 October 2011 (UTC)
Apparently, in testing on twelve different systems here (old systems i didnt mind imploding), defusing the fork bomb as mentioned in the section where the fork bomb is this:
:(){ :|: & };:
does not work. This was posed as a solution:
:(){ . & };
***This does not work***. -- TrekCaptainUSA (without login, due to a bug in the web browser being used)
The graphic in the intro doesn't represent a canonical fork bomb properly, it represents one using wait()
, which doesn't make any sense. The graphic should probably be fixed to actually represent what a canonical fork bomb looks like.
Cdwn (
talk)
02:33, 19 September 2012 (UTC)
Is it really a good idea to have a vast "examples" section? I see them only in other articles that describe features that are programming language related, but a fork bomb is not a programming feature, it's a computing phenomena. If there are no objections, I would seek to remove it, and replace it with descriptive pseudocode. Cdwn ( talk) 14:34, 26 September 2012 (UTC)
The whole "Defusing" section appears to be original research. I'll try and find some references and clean it up, but otherwise failing that I'll just remove it. Cdwn ( talk) 14:46, 26 September 2012 (UTC)
Ideally there should also be information about fork bomb prevention on other common systems (Windows in particular). I didn't find any good references on the subject after a quick skim, but I'll keep on looking. Cdwn ( talk) 18:30, 27 September 2012 (UTC)
well done for messing up a good page from a user. you are so fail. — Preceding unsigned comment added by 86.148.12.80 ( talk) 15:05, 1 October 2012 (UTC)
A few weeks ago, I removed unreferenced content in the form of a "defusal" section in the article (see here). This content was today readded by another editor. Does my original removal under WP:OR seem appropriate? Would there be further objections to the re-removal of the content? — cdwn 23:05, 15 October 2012 (UTC)
I re-added the information because it contains data I've used in the past to fiddle about with forkbombs. I've never personally succeeded in defusing one myself, so I suppose I could open up a virtual machine and test it out, but if personal research is really going to be removed from wikipedia I guess there really is no point in doing so. — Preceding
unsigned comment added by
74.195.36.241 (
talk)
02:52, 17 October 2012 (UTC)
Feel free to add this "finding" to the article if you think it belongs there - in a more encyclopaedic format obviously.
While compiling stuff on a remote server, I got really bored. Long story short - the bash forkbomb from this article works very nicely on Windows in Cygwin.
Not only that, but Windows' equivalent to `killall` is quite weak at dealing with it. It kills some (but not all) of the forked processes on this Windows 7 machine (using "taskkill /f /im sh.exe"), so the "survivors" continue forking. I had to run the command almost a dozen times before it killed every last fork...
I didn't see the process count, but the handle count in task manager went from 25000 to around 80000 before I got the first kill order dispatched.
194.150.65.97 ( talk) 03:16, 27 August 2014 (UTC)
== Issue with the C example As it is as I write this, the C example reads:
#include <unistd.h>
int main(void)
{
while(
fork()
);
}
and as this stands, this will produce linear, not expoential growth. The reason is due to the return value of the fork() function, which the manpage informs is 0 in the child process. Thus this will be an infinite loop in the parent process, but child processes will exit the while() immediately and then quit. Thus it should read:
#include <unistd.h>
int main(void)
{
while(1) fork();
}
or
#include <unistd.h>
int main(void)
{
for(;;fork());
}
so that the return value of fork() is of no consequence. I have modified the page to reflect the while(1) fork(); example. Chalisque ( talk) 18:46, 28 December 2015 (UTC)
Look at the first page of the history and you can see that the example section expands exponentially over time as everyone rushes to include snippets of their favourite languages. Previous revision had "Example in X ... And in Y ... Any in Z ... and in AA ..." and it went on and on and on for well over 50% of the content of the page.
This article is not a gallery of fork bombs. If people want to write one, they can go to Google and search for "fork bomb in [my favourite language]". This article is now much more readable.
180.15.182.119 (
talk)
13:13, 19 February 2017 (UTC)
This GitHub page contains examples of fork bombs in numerous languages; more than this article does. I don't think Wikipedia is the place for a list of examples. Instead, the article could link to this page, and we could remove the examples from the article. Maybe we could keep one or two examples to demonstrate how the fork bomb actually works (like keeping the C code and explaining it). Thoughts? Sebastian Talk | Contrib. - 03:12, 28 March 2020 (UTC)
68.205.84.110 ( talk) 16:11, 24 April 2020 (UTC)
MOVE THEM BACK!
Response to Preface: I agree that the article was memorable; in fact I discovered it from the cron.weekly newsletter as one of the links. The article was linked primarily because of its long list of examples. However, I still don't think that such a list is fit for Wikipedia. Wikipedia is intended to be an encyclopedia, and while a couple of examples of a concept can help further understanding (as it does in this article's current state), showing an example of a fork bomb in every language in which it is possible doesn't align with the goals of an encyclopedia. If they were on their own dedicated article, the discussion would be much different, but here it doesn't really make that much sense.
1) Would you be willing to elaborate on this point? I disagree here: as I said above, the numerous examples didn't help to further understanding of the topic, and if anything they distracted from the main content of the article itself. If you feel that the article is incomplete for whatever reason, you can edit the page with some content that you think would fit in nicely. But I don't think that an article is "bogus" or "incomplete" just because it's short. If an article can convey the information it needs to in a short amount of space, that seems like a good thing.
2) Do you know of any other articles that follow the same layout as this one did? If there is a precedent on Wikipedia for these kinds of long-winded lists, then I will happily consider changing my mind on this decision. But as of now, I don't think that long lists of examples define what Wikipedia is in essence. Wikipedia is an online encyclopedia.
3) The goal of Wikipedia is not to attract as many visitors as possible; it is to spread free knowledge. Wikipedia is not a commercial product, and I am strongly against justifying modifications to Wikipedia in the sole interest of increasing traffic to the site.
4) This is a reasonable concern. However, in the event that something happens to the GitHub repo, this page can simply just link to the WayBack Machine's archive of the repo. And where else on Wikimedia could the list be moved to? I would be in favor of making a separate article on Wikipedia itself for the list, but if there's a better place for it then I'd like to hear that.
5) I have no objections to this argument. You make a good point there.
6) Content gets removed from Wikipedia all the time, and I'm sure that nearly everyone who's edited Wikipedia for a decent amount of time has had some of their edits removed or reverted. To do so is not a personal attack on any of the authors of said content, especially if all authors share the mutual goal of wanting the site to become better. Of course, it can be very difficult and crushing if things that you worked very hard on are suddenly deleted, but I don't think that's a valid argument to simply not remove things.
7) If the popular majority of Wikipedians disagree with me, then I am 100% okay with helping them re-instate the examples section to its former glory. But as of now it seems like the issue is pretty split, and the examples section hasn't been re-added yet.
8) This isn't really an argument against the removal of the section; it's just a plead.
9) Why not? MediaWiki was "optimized" to allow for viewing of old revisions of articles, and if it works, then there's no reason that Wikipedia "shouldn't be used" like that.
10) The content isn't lost, as you pointed out yourself in #9. Though like I said, if others share your point of view on the situation, then I would happily support and even help out with re-instating the section.
Finally, I'd be in favor of creating a separate Examples of fork bombs article, though it seems like such an article was already created in the past and deleted (the request for deletion is here). The debate there seems to have already been settled; and recreating the article most likely wouldn't accomplish anything but waste the admins' time on having to delete it yet again. I'm willing to hear any more points you or others may have, though let's all try to keep things civil. Sebastian Talk | Contrib. - 00:45, 28 December 2020 (UTC)
![]() | This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
![]() | The contents of the Wabbit (computing) page were merged into Fork bomb. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
Hi. I'm the one who published the Forkbomb SHELL code :(){ :|:& };: as a work of art in 2002. My artwork used to be quoted in this article, as an example which is still there. A few months ago this reference was deleted and I asked the one who deleted why. Here is the discussion (update! now even the discussion has been deleted!). Anyway, I'm looking forward to read your opinions on art :^) And I hope I won't be removed from this little part of Internet history, that forkbomb was a source of inspiration for this article. ciao jaromil ( talk) 00:17, 28 October 2012 (UTC)
Are you seriously claiming ownership of a simplistic bash command line under the guise of art? Really? 71.92.36.147 ( talk) 07:47, 8 November 2012 (UTC)
Following recent edits, I'd like to thank the editors involved for restoring a whole lot of information that was present on this article and deleted without much discussion. Regarding the "elegant" definition of the :(){ :|:& };: forkbomb, here is the statement of a well known art critic and computational linguist http://runme.org/feature/read/+forkbombsh/+47/ among other awards and reviews. This runme link was what is now a missing reference resulting from the deletion. ciao jaromil ( talk) 13:38, 7 March 2013 (UTC)
Removed wording suggesting Jaromil invented this snippet. It has been shown in numerous sources that this has existed long before he supposedly came up with it. He may have independently came up with it without having knowledge of it prior, but is no reason to credit him as the creator. http://www.oocities.org/f173s/sendmail-8_8_x-8_9_x.txt https://groups.google.com/forum/?hl=en&fromgroups#!topic/muc.lists.bugtraq/CH1RVi3TWZo 65.5.176.229 ( talk) 16:45, 7 March 2013 (UTC)
Who displayed what for whatever is irrelevant to the topic of this page. Citing the bash fork bomb as being displayed as art once upon a time doesn't belong here. I have removed the reference. 75.131.26.156 ( talk) 04:45, 9 March 2013 (UTC)
Beware Wikipedia editors: this page is being targeted by deletionism. The page recent history will show several unsigned interventions aimed at deleting content and omitting historical information. jaromil ( talk) 09:54, 12 April 2013 (UTC)
Removed reference to it being 'art' at some event once more; IT DOESN'T BELONG! Stop adding it. 68.114.46.33 ( talk) —Preceding undated comment added 22:12, 24 June 2013 (UTC)
Please stop edit warring over this sentence! Jaromil, I've reworded the bit about the artwork and added a reference, but dropped your name; if an uninvolved party feels that the name should be included they're welcome to put it back in. IP addresses, I personally believe that the possibility that fork bombs could be regarded as art merits inclusion in the article, but I'm open to other opinions. — Wolfgang42 ( talk) 17:35, 1 July 2013 (UTC)
I think the example should be removed entirely due to the fact that it cannot work as intended in any POSIX-compliant shell, including Bash's POSIX mode. It isn't technically valid shell code, and can only work due to quirks specific to Bash's non-POSIX mode, and in Zsh due to it having the right combination of bugs. I covered the problem in more detail in this article a while ago. Aside from the reserved function name, it isn't the most effective implementation. The `&` is just shooting yourself in the foot because the caller now doesn't need to wait for the subshell functions to return and is free to exit immediately, thus the second function call isn't accomplishing anything other than the net effect of replacing the caller, so this is not exponential growth. Also, the pipeline slows down the calls by making unnecessary system calls to set up the pipe and redirect I/O between processes that never read or write anything. This fork bomb could be "improved" using something like: `f() { f & f; };` or `f() { f & f & wait; };`. Ormaaj ( talk) 09:49, 23 May 2014 (UTC)
I do not think the Java Applet example is a fork bomb: 1) It does not spawn processes. 2) Even if you are liberal and define a "new thread" to count as a "new process", this example's new threads do not spawn new threads themselves, which is the signature "forking" element of the fork bomb. It is my opinion that this example is designed to deny CPU cycles rather than deny process table entries and/or thread handles. I intend to remove this example in a month or so, unless someone can convince me that this code really does represent a fork bomb. - MC ( talk) 05:01, 24 July 2010 (UTC)
Can anyone prevent a fork bomb in windows? If so please put it on the main page —Preceding
unsigned comment added by
79.97.217.123 (
talk)
00:10, 28 November 2008 (UTC)
I got here from
wabbit but this is not explained. Can someone please do so! --
HappyDog 17:12, 31 Jan 2004 (UTC)
Why the "%0|%0" windows example was removed (by Andrew Hampe)? Is it not the most concise example for the windows platform and worth including? -- LKRaider ( talk) 12:41, 10 December 2007 (UTC)
Why do you include two versions in perl? Both of them are in fact the same.
89.77.174.218 (
talk)
09:40, 27 February 2008 (UTC)
Article mentions that bash fork bomb was created by Jaromil in 2002.
I was able to find posts of a polish white hat - lcamtuf from 1999 in usenet, in which he had this fork bomb in his signature.
Necc (
talk)
17:25, 13 March 2008 (UTC)
It doesn't say that he came up with that piece of code. I just remember him having it a long time ago before apparently it was invented :] Here's an example, although you can find it in most of his emails from that period: http://groups.google.co.uk/group/muc.lists.bugtraq/browse_thread/thread/87d51562dd3599a/044c5404a9860dd4 Necc ( talk) 20:12, 17 March 2008 (UTC)
The Erlang fork bomb should be removed; the processes created by Erlang are restrained to the virtual machine and only dispatched and load balanced by the VM itself. They're NOT OS level threads. Hitting the limit of Erlang processes will thus only crash the Erlang VM and will not influence anything else. I believe the example should be removed, as it's misleading and doesn't fit the definition. —Preceding unsigned comment added by Mononcqc ( talk • contribs) 16:35, 19 April 2009 (UTC)
I tried it both before and after fork bombing. It just says: -bash: !: event not found
What is actually the '!'? —Preceding unsigned comment added by Ehasl ( talk • contribs) 20:11, 25 April 2008 (UTC)
Getting rid of a forkbomb on Linux systems even if the process table is full is possible.
1. Press Ctrl+Alt+F1. After a while you should see the login: prompt
(if something else is there use Ctrl+Alt+F2 etc until you find one)
2. Login as root. Once again, this might take awhile
3. Issue kill -9 -1. This might take a while again but once it is done, the forkbomb is dead, as is everything else
4. issue init 1 followed by init 5 to restart system services —Preceding
unsigned comment added by
64.139.38.226 (
talk)
23:22, 11 August 2008 (UTC)
Should Wikipedia include what errors, etc. come up during a fork bomb? IE: Windows Command Line in Vista states that "The process tried to write to a nonexistent pipe." This usually occurs late in the fork bomb. 24.183.100.243 ( talk) 02:24, 20 January 2009 (UTC)
Neither it works in Windows 7 also:
C:\Users\Dyr>:s
C:\Users\Dyr>start %0
Не удается найти файл %0.
C:\Users\Dyr>goto :s
C:\Users\Dyr>%0|%0
"%0" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
C:\Users\Dyr>
--
217.119.16.26 (
talk)
12:21, 6 April 2010 (UTC)
claiming Windows is not a real operating system? baka, windows is a very real and very popular OS; anyway, this DOES apply to windows 7, you just need it to run as a .bat file ^^ save %0|%0 in a .bat file, and run it, then open taskmgr.exe .. luckily you can easily "defuse the bomb" by spamming the X button on the batch window ^^ Divinity76 ( talk) 12:45, 5 February 2014 (UTC)
Removed the how-to tag, these are elegant examples that aid description, programming is about instruction it is an unavoidable consequence that this resembles a how to. You would not stigmatise an arts page as how-to because they have a gallery of examples. I agree its got a bit out of hand on this page with the fanboy attitude of adding every language under the sun :S but deciding what languages are significant is another story. MattOates (Ulti) ( talk) 08:04, 3 June 2009 (UTC)
I know that Fork Bombs are relatively harmless since they can be terminated through a log off, or a reboot, but is it really a good thing to produce so many examples of them on this one page. It just seems like any sort of malicious code, virus, or bomb should not be posted in a place like this. 143.112.32.4 ( talk) 20:53, 5 January 2010 (UTC)
i agree what if terrist git this kode and bomb murrica!!!! —Preceding unsigned comment added by 86.42.170.162 ( talk) 19:45, 12 February 2010 (UTC)
Why do you push and pop from the stack? Isn't this better?
section .text
_start:
? —Preceding unsigned comment added by 85.167.25.91 ( talk) 14:51, 2 July 2010 (UTC)
Don't most fork bombs allocate each process memory with Malloc or whatever language specific memory allocation function that language uses? So shouldn't the C/C++ examples malloc themselves, I don't know, 100 MB? Mmavipc ( talk) 05:55, 2 September 2010 (UTC)
The classic ":(){ :|:& };:" bomb doesn't seem to work on newer bash versions anymore - it gives a syntax error. -- 187.15.115.138 ( talk) 18:10, 25 September 2010 (UTC)
:
is not synonymous with true, it is a noop that just happens to return true.
Cdwn (
talk)
02:35, 19 September 2012 (UTC)
man true
. true is a command, which always returns exit code 0 (success). :
is a builtin doing exactly the same.
Nyh (
talk)
21:38, 20 September 2012 (UTC)
true
that you are probably using, as true
is also a shell builtin. Compare strace bash -c :
and strace bash -c true
; they do not perform the same internally. Either way, my intention was only to correct a factual inaccuracy, not engage in pedantry over function vs. form (or the meaning of what it is to be "synonymous"...).
Cdwn (
talk)
14:22, 26 September 2012 (UTC)I tried uploading the full version of the fork-bomb shell script to virustotal.com, and no engines detect it. (A handful of antivirus engines detect the "%0|%0" version.) Why do so few anti-malware apps detect the fork-bomb shell script, and what's the best way to scan a shell script to see if it is malicious or not? Bwrs ( talk) 07:39, 3 April 2021 (UTC)
I removed the M forkbomb, because it was wrong. A real one would look like this:
f f j f
but I think that the whole examples section is OR, so I'm just going to leave it out. 24.177.120.138 ( talk) 07:50, 17 April 2011 (UTC)
And it should probably be referred to as common lisp, rather than just lisp. It can't be made multi-threaded, let alone multi-process, as forking and threading are undefined in the standard. Maybe it should be deleted or changed to an implementation dependent version? —Preceding unsigned comment added by 138.37.91.30 ( talk) 16:14, 26 April 2011 (UTC)
ABAP Version was just an infinite loop and not a fork bomb. Given the fixed number of process slots Netweaver has with a roll-in/roll-out mechanism a forkbomb does not quite make sense - it would not bring the system completely to its knees, it would just drastically degrade performance. I guess a semi fork-bomb can be made using CALL FUNCTION .. IN BACKGROUND TASK. — Preceding unsigned comment added by 41.185.97.170 ( talk) 09:07, 22 September 2011 (UTC)
I will be editing this because it doesn't use any functions or syntax specific to C++, and also it uses the C standard library to actually use the system() function. Also, I have general issues with it: I'm not sure it's a proper fork bomb as it consumes one thread and only one of the processes is using the CPU; all the others appear to be idle. None daemonise from the calling shell. -- Adamd1008 ( talk) 18:14, 7 October 2011 (UTC)
Apparently, in testing on twelve different systems here (old systems i didnt mind imploding), defusing the fork bomb as mentioned in the section where the fork bomb is this:
:(){ :|: & };:
does not work. This was posed as a solution:
:(){ . & };
***This does not work***. -- TrekCaptainUSA (without login, due to a bug in the web browser being used)
The graphic in the intro doesn't represent a canonical fork bomb properly, it represents one using wait()
, which doesn't make any sense. The graphic should probably be fixed to actually represent what a canonical fork bomb looks like.
Cdwn (
talk)
02:33, 19 September 2012 (UTC)
Is it really a good idea to have a vast "examples" section? I see them only in other articles that describe features that are programming language related, but a fork bomb is not a programming feature, it's a computing phenomena. If there are no objections, I would seek to remove it, and replace it with descriptive pseudocode. Cdwn ( talk) 14:34, 26 September 2012 (UTC)
The whole "Defusing" section appears to be original research. I'll try and find some references and clean it up, but otherwise failing that I'll just remove it. Cdwn ( talk) 14:46, 26 September 2012 (UTC)
Ideally there should also be information about fork bomb prevention on other common systems (Windows in particular). I didn't find any good references on the subject after a quick skim, but I'll keep on looking. Cdwn ( talk) 18:30, 27 September 2012 (UTC)
well done for messing up a good page from a user. you are so fail. — Preceding unsigned comment added by 86.148.12.80 ( talk) 15:05, 1 October 2012 (UTC)
A few weeks ago, I removed unreferenced content in the form of a "defusal" section in the article (see here). This content was today readded by another editor. Does my original removal under WP:OR seem appropriate? Would there be further objections to the re-removal of the content? — cdwn 23:05, 15 October 2012 (UTC)
I re-added the information because it contains data I've used in the past to fiddle about with forkbombs. I've never personally succeeded in defusing one myself, so I suppose I could open up a virtual machine and test it out, but if personal research is really going to be removed from wikipedia I guess there really is no point in doing so. — Preceding
unsigned comment added by
74.195.36.241 (
talk)
02:52, 17 October 2012 (UTC)
Feel free to add this "finding" to the article if you think it belongs there - in a more encyclopaedic format obviously.
While compiling stuff on a remote server, I got really bored. Long story short - the bash forkbomb from this article works very nicely on Windows in Cygwin.
Not only that, but Windows' equivalent to `killall` is quite weak at dealing with it. It kills some (but not all) of the forked processes on this Windows 7 machine (using "taskkill /f /im sh.exe"), so the "survivors" continue forking. I had to run the command almost a dozen times before it killed every last fork...
I didn't see the process count, but the handle count in task manager went from 25000 to around 80000 before I got the first kill order dispatched.
194.150.65.97 ( talk) 03:16, 27 August 2014 (UTC)
== Issue with the C example As it is as I write this, the C example reads:
#include <unistd.h>
int main(void)
{
while(
fork()
);
}
and as this stands, this will produce linear, not expoential growth. The reason is due to the return value of the fork() function, which the manpage informs is 0 in the child process. Thus this will be an infinite loop in the parent process, but child processes will exit the while() immediately and then quit. Thus it should read:
#include <unistd.h>
int main(void)
{
while(1) fork();
}
or
#include <unistd.h>
int main(void)
{
for(;;fork());
}
so that the return value of fork() is of no consequence. I have modified the page to reflect the while(1) fork(); example. Chalisque ( talk) 18:46, 28 December 2015 (UTC)
Look at the first page of the history and you can see that the example section expands exponentially over time as everyone rushes to include snippets of their favourite languages. Previous revision had "Example in X ... And in Y ... Any in Z ... and in AA ..." and it went on and on and on for well over 50% of the content of the page.
This article is not a gallery of fork bombs. If people want to write one, they can go to Google and search for "fork bomb in [my favourite language]". This article is now much more readable.
180.15.182.119 (
talk)
13:13, 19 February 2017 (UTC)
This GitHub page contains examples of fork bombs in numerous languages; more than this article does. I don't think Wikipedia is the place for a list of examples. Instead, the article could link to this page, and we could remove the examples from the article. Maybe we could keep one or two examples to demonstrate how the fork bomb actually works (like keeping the C code and explaining it). Thoughts? Sebastian Talk | Contrib. - 03:12, 28 March 2020 (UTC)
68.205.84.110 ( talk) 16:11, 24 April 2020 (UTC)
MOVE THEM BACK!
Response to Preface: I agree that the article was memorable; in fact I discovered it from the cron.weekly newsletter as one of the links. The article was linked primarily because of its long list of examples. However, I still don't think that such a list is fit for Wikipedia. Wikipedia is intended to be an encyclopedia, and while a couple of examples of a concept can help further understanding (as it does in this article's current state), showing an example of a fork bomb in every language in which it is possible doesn't align with the goals of an encyclopedia. If they were on their own dedicated article, the discussion would be much different, but here it doesn't really make that much sense.
1) Would you be willing to elaborate on this point? I disagree here: as I said above, the numerous examples didn't help to further understanding of the topic, and if anything they distracted from the main content of the article itself. If you feel that the article is incomplete for whatever reason, you can edit the page with some content that you think would fit in nicely. But I don't think that an article is "bogus" or "incomplete" just because it's short. If an article can convey the information it needs to in a short amount of space, that seems like a good thing.
2) Do you know of any other articles that follow the same layout as this one did? If there is a precedent on Wikipedia for these kinds of long-winded lists, then I will happily consider changing my mind on this decision. But as of now, I don't think that long lists of examples define what Wikipedia is in essence. Wikipedia is an online encyclopedia.
3) The goal of Wikipedia is not to attract as many visitors as possible; it is to spread free knowledge. Wikipedia is not a commercial product, and I am strongly against justifying modifications to Wikipedia in the sole interest of increasing traffic to the site.
4) This is a reasonable concern. However, in the event that something happens to the GitHub repo, this page can simply just link to the WayBack Machine's archive of the repo. And where else on Wikimedia could the list be moved to? I would be in favor of making a separate article on Wikipedia itself for the list, but if there's a better place for it then I'd like to hear that.
5) I have no objections to this argument. You make a good point there.
6) Content gets removed from Wikipedia all the time, and I'm sure that nearly everyone who's edited Wikipedia for a decent amount of time has had some of their edits removed or reverted. To do so is not a personal attack on any of the authors of said content, especially if all authors share the mutual goal of wanting the site to become better. Of course, it can be very difficult and crushing if things that you worked very hard on are suddenly deleted, but I don't think that's a valid argument to simply not remove things.
7) If the popular majority of Wikipedians disagree with me, then I am 100% okay with helping them re-instate the examples section to its former glory. But as of now it seems like the issue is pretty split, and the examples section hasn't been re-added yet.
8) This isn't really an argument against the removal of the section; it's just a plead.
9) Why not? MediaWiki was "optimized" to allow for viewing of old revisions of articles, and if it works, then there's no reason that Wikipedia "shouldn't be used" like that.
10) The content isn't lost, as you pointed out yourself in #9. Though like I said, if others share your point of view on the situation, then I would happily support and even help out with re-instating the section.
Finally, I'd be in favor of creating a separate Examples of fork bombs article, though it seems like such an article was already created in the past and deleted (the request for deletion is here). The debate there seems to have already been settled; and recreating the article most likely wouldn't accomplish anything but waste the admins' time on having to delete it yet again. I'm willing to hear any more points you or others may have, though let's all try to keep things civil. Sebastian Talk | Contrib. - 00:45, 28 December 2020 (UTC)