A stack overflow is technically a segmentation violation. At least on linux the program recives the SIGSEGV signal.
This compiles and I am no rust dev but this does not use unsafe code, right?
While the compiler shows a warning, the error message the program prints when run is not very helpfull IMHO:
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 45211 IOT instruction (core dumped) ../target/debug/rust
Edit: Even the compiler warning can be tricked by making it do recusion in pairs:
Challange accepted. The following Rust code technically segfaults:
A stack overflow is technically a segmentation violation. At least on linux the program recives the SIGSEGV signal. This compiles and I am no rust dev but this does not use
unsafe
code, right?While the compiler shows a warning, the error message the program prints when run is not very helpfull IMHO:
Edit: Even the compiler warning can be tricked by making it do recusion in pairs:
Fair point.