less_retarded_wiki/compiler_bomb.md
2024-03-02 20:30:32 +01:00

1.4 KiB

Compiler Bomb

Compiler bomb is a type of software bomb (similar to fork bombs, zip bombs, tar bombs etc.) exploiting compilers, specifically it's a short program (written in the compiler's programming language) which when compiled produces an extremely large compiled program (i.e. executable binary, bytecode, transpiled code etc.). Effectiveness of such a bomb can be measured as the size of output divided by the size of input. Of course compiler bombs usually have to be targeted at a specific compiler (its weaknesses, optimizations, inner mechanisms, ...), the target platform and so on, however some compiler bombs are quite universal as many compilers employ similar compiling strategies and produce similar outputs. Alternatively a compiler bomb can be defined to do other malicious things, like maximizing the amount of RAM and time needed for compilation etc.

{ Found here: https://codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb. ~drummyfish }

Compiler bombs in various languages:

  • C: main[-1u]={1};, creates 16 GB executable, works by defining a huge array an initializes its first element so the whole array will be explicitly stored in the executable.
  • Rust: every program :D
  • comun: TODO :-}
  • ...