Access Violation Tracking

Etienne via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 9 06:33:29 PST 2014


On 2014-11-05 6:09 AM, Bauss wrote:
> Is there any way to track down access violations, instead of me having
> to look through my source code manually.
>
> I have a pretty big source code and an access violation happens at
> runtime, but it's going to be a nightmare looking through it all to find
> the access violation. Not to mention all the tests I have to run.
>
> So if there is a way to catch an access violation and find out where it
> occured it would be appreciated!

I've seen a lot more invalid memory operation errors since the GC calls 
destructors. Letting the GC destroy objects out of order can be the 
issue. We might have to make an associative array of static global flags 
(debug bool[void*]) for each object to see if it was destroyed, and use 
asserts in the destructors / update the associative array, as a new idiom.


More information about the Digitalmars-d-learn mailing list