Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modern equivalent of BoundsChecker for Visual Studio 2008 [closed]

Tags:

c++

In VS6 times there was BoundsChecker from Numega. I understand it is dead now, please correct me if I am wrong. What are the reliable alternatives? Preferably free or at least with trial version available.

like image 643
Secure Avatar asked Dec 18 '22 01:12

Secure


1 Answers

IMO It might be a better idea to write custom memory manager (the one that supports new/delete/malloc/free wrappers). Make a new/delete wrapper that locks unused/freed memory using VirtualProtect (yeah, I know that default allocation block will have to be PAGE_SIZE bytes large, and you'll need a lot of ram even for a small app, but that's the only disadvantage). If you are on linux, it probably have VirtualProtect alternative. In this case any outrageous out-of-bounds access will generate access violation and will be easy to track. Also use stl containers when possible - they also offer bounds checking.

This advice is based on experience - I had worked with a terribly written huge (several megabytes of code) old software that had memory leaks, accessed already freed memory from multiple threads and so on. I've spent week trying different utilities (purify, devpartner studio, aqtime etc), and although some of them provided loads of information, none were really helpful. With custom memory managment problems were eliminated in 2 days (that includes writing memory manager).

If that doesn't work for you, try compuware devpartner studio - if it is still available anywhere.

like image 132
SigTerm Avatar answered Dec 24 '22 00:12

SigTerm