Sometimes, within the compiler, there might be some cached data that should not be there after you have changed and compiled a new set of codes. This page shows a few ways you can clear out the compiler's cached data to have everything run in expectation.
Things you may do to try to get a clean slate:
- clean cm. (C-c C-m)
- clean libs. (C-c C-l)
- remove C:\CetDev\workspace name\write.
- remove all cmpref files. (found in C:\Users\username\Documents\CET Documents\Preferences on win7 or above)
- rebuild DLLs.
- make sure you have the latest revision of all files and that you have not accidentally mixed files from different branches.
Recovering From a Crash
If you encounter a crash in CET during development, there are several things you can do to try to recover.
- C-M-q: Send ‘quit()’ to the compilation process
Essentially tries to recover gracefully from an error. Quits the current process and goes back to the process before the crash. If you know the crash location, fixing the error followed by this command should allow you to resume operating CET. Should almost always work for access violations, minor snapper crashes, crashes during an animation, and develop mode only “bug” statements.
- C-M-e: Send ’exit()’ to the compilation process
Exits CET without a full clean. Useful when you want to do a quick restart and you know you don’t need to clean the compiler.
- C-c C-m/C-c RET: Make clean-cm in the top-level directory
Performs a full clean. This is essentially the same as “Clean Start” in production. This will take significantly longer to perform in comparison to using the exit command above but will ensure you have a clean slate.
In general, the order of the commands above is the order that should be attempted when trying to recover from a crash as the time taken will take significantly longer as you go down the list.
Performing a clean start is often necessary but the whole process takes up a significant amount of time each time. You can shorten this process by creating a compiler snapshot. This way, the next time you restart after cleaning, the compiler will load from a snapshot instead of having to compile everything again.
- C-c f9: Make compiler snapshot
- C-c M-RET: Clean cm and remove compiler snapshot
Before making a snapshot, you should ensure that all the packages that you want to load have been compiled and that the compiler is in a stable state. One useful example of this is when working with undo crashes. If you manage to create a reproducible case, then right before the crash, you can load all the packages you need then save a snapshot. When it crashes again and you perform a clean restart, CET will start up quickly and you can continue where you left off. After the bug has been resolved, you can remove the snapshot.
If you get the "compilation finished" message immediately at startup, the first things to check are _cm.exe and _cvm.dll which are both present in your installation. If you are working in the master branch you should be able to find them in the C:\CetDev\workspace name\base\bin\win64 folder.
Other potential problems could be:
- the process ran out of memory or address space
- bugs in DLLs (stack is messed up by code that runs amok)
- bugs in DLLs (bad use of pointers or other problems in C++)
- infinite recursion in CM code
- compiler bugs