Problem about a crazy function: exit(0)

My board type is RCM3000. I get a problem about exit function.

If the board is running at Debug Mode, whether we called exit function, it is ok.

If the board is running at Running Mode, there are two results: Called function exit, the program is ok. If not called exit function, the program is bad.

I apologize, I do not understand. can you add a sample to show what you are doing?