less_retarded_wiki/compiler_bomb.md

12 lines
1.4 KiB
Markdown
Raw Normal View History

2024-02-13 21:57:06 +01:00
# Compiler Bomb
2024-03-02 20:30:32 +01:00
Compiler bomb is a type of [software bomb](software_bomb.md) (similar to [fork bombs](fork_bomb.md), [zip bombs](zip_bomb.md), [tar bombs](tar_bomb.md) etc.) exploiting [compilers](compiler.md), specifically it's a short [program](program.md) (written in the compiler's [programming language](programming_language.md)) which when compiled produces an extremely large compiled program (i.e. executable binary, [bytecode](bytecode.md), [transpiled](transpilation.md) 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](ram.md) and time needed for compilation etc.
2024-02-13 21:57:06 +01:00
{ Found here: https://codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb. ~drummyfish }
Compiler bombs in various languages:
- [C](c.md): `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.
2024-02-26 11:38:00 +01:00
- [Rust](rust.md): every program :D
2024-03-02 20:30:32 +01:00
- [comun](comun.md): TODO :-}
2024-02-13 21:57:06 +01:00
- ...