简体   繁体   中英

Run-Time Error Checks /RTCs

I enabled in /RTCs in my application to detect stack corruption issues. The application has many components(dlls) and the total LOC is about 40K. It has many threads.

Initially I was getting the crash after executing 18000 cycles. But after enabling the /RTCs option, I am getting the carsh within 100 cyles. The crash always occurs in a thread called Reciever Thread. But it crashes consistently at 3 or 4 locations. When the crash occurs almost all local variables looks like corrupted in some cases. But I am not able to identify the root cause as I cannot see any issues around the points at which the crash occurs.

What things can I do to narrow down the point where the stack is corrupting?
The code has try catch statements, will it prevent identifying the cause?

Please help me

Thanks!

Edit: Are you using optimisatons:

If you compile your program at the command line using any of the /RTC compiler options, any pragma optimize instructions in your code will silently fail. This is because run-time error checks are not valid in a release (optimized) build.

You should use /RTC for development builds; /RTC should not be used for a retail build. /RTC cannot be used with compiler optimizations (/O Options (Optimize Code)). A program image built with /RTC will be slightly larger and slightly slower than an image built with /Od (up to 5 percent slower than an /Od build).

Without you posting any code I can only suggest general tools.

I use valgrind --tool=helgrind on Linux for this kind of thing, but I am guessing from your question that you are on Windows.

You might find the answers to this question useful: Is there a good Valgrind substitute for Windows?

(It might help if you post the code where you are getting problems or indicate what methods you have used to protect the variables that seem to be corrupted (mutexes and the like...) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM