23

TIL a new way to crash a computer.
Open a python shell
>>> [i for i in range(10000000000)]

Comments
  • 4
    [i for i in range(10**10**10)]
  • 2
    Only python2 preallocates the range. Python3 doesn't anymore
  • 2
    [i for i in range(9999999**9999999999**999999999999)]
  • 1
    list(range(10**10))
  • 2
    @ilikeglue if you look closely this is a list comprehension, so list is populated.
    A = range(10000000000) won't crash because it returns a generator
  • 3
    Shortest crash: `def k;k;end`
    Not python, though.
  • 1
    *x, = range(1000000000000)
  • 1
    💻🔨
  • 1
    @Root That'll just recurse, not crash. Fork bomb is in fact shorter and does crash there
  • 1
    @Proximyst It'll still crash (the Ruby interpreter at least) due to a call stack overflow.

    Bash fork bomb is actually the same length: 11 chars; definitely more effective, however ~

    Edit: fork bomb is 12 chars minimum, so it's longer 😋
  • 2
    @Root Damn, you got me there, but I at least only know how Crystal works in that :p
  • 0
    Somehow it's killed ...
Add Comment