The Cooja simulator is an integral part of the Contiki distribution: all the automated regression tests are run in Cooja. Cooja is actually very reliable, but because it runs user code in the same process as the simulator in the most high-performance mode (for performance reasons) it is not uncommon for user code to crash the simulator. My guess is that this was the problem in your case, particularly if this was your first significant C project.
It is possible to run Cooja in an emulation mode too (but only for the MSP430 microcontroller) where the user and OS code is completely isolated from the simulator process - much more reliable and easier to find bugs that break the user code, but much, much slower.