why did it crash? Rust is supposed to be memory safe?..

crashes happen for reasons besides memory safety. web-engines are crazy complicated pieces of software and crashes could happen for any number of reasons. also I would be shocked if this was written using purely safe rust

The JS engine is SpiderMonkey, which is C++.