开发者

Run-Time Error Checks /RTCs

开发者 https://www.devze.com 2023-03-03 23:12 出处:网络
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.

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.开发者_StackOverflow中文版 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...) )

0

精彩评论

暂无评论...
验证码 换一张
取 消