Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

'attack' causes fork bomb in Windows #25

Merged
merged 1 commit into from

2 participants

@strathmeyer

The multiprocessing library needs special treatment in Windows, otherwise it causes a fork bomb. This is a known issue.
Bug description: http://bugs.python.org/issue6147

The best fix seems to be to wrap the main entry point in a name == 'main' check.
Fix description: http://docs.python.org/library/multiprocessing.html#windows

With this fix (and renaming bees to bees.py in my Scripts folder) I can happily cause destruction.

@onyxfish onyxfish merged commit b2775ff into newsapps:master
@onyxfish

Ha! Thanks for the fix. I love this bug.

@strathmeyer

It was an awesome bug to encounter.

'bees up' worked like a charm. But once I tried 'attack', the trouble began. The output started as just a bunch of repetitions of "Read X bees.... Stinging URL..." but then the different processes would start to overlap each other "RRRead 4 bees from the roster.ead 4 bees Connecting to the hive.from the roster." Then my machine became unusable... Good times! :D

@onyxfish

Tremendous, I'm glad to have a Windows tester to encounter these things for me. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2012
  1. @strathmeyer
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  bees
View
3  bees
@@ -2,4 +2,5 @@
from beeswithmachineguns import main
-main.main()
+if __name__ == '__main__':
+ main.main()
Something went wrong with that request. Please try again.