Hi, I have a huge project (threaded) and it crash very rare times, but it does with a invalid memory error.
I think this can be caused while acceding to a global variable not locked with mutex.
Is there a way to know if a gloval variable is inside LockMutex-UnlockMutex pair?
Thanks in advance
P.D: The project is a DLL dependant of another app (not mine) and I can´t use (or don't know how) the purifier
Know if a global var is inside mutex?
Re: Know if a global var is inside mutex?
Not definitely, no. You could 'grep' lines containing the word 'Mutex'. Hopefully, reducing the number of lines you have to review and collecting them together will make reviewing for improper mutex handling slightly more easy. Something like this powershell command will output procedure start/ends and lock/unlock mutex lines. If you add in the name of your suspect variable as an alternate too then you will get output which should be relevant to your investigation rather than having to review the whole source.
Code: Select all
select-string -Path "*.pb" -Pattern "(Procedure|EndProcedure|LockMutex|UnlockMutex|MyVariable)"
Re: Know if a global var is inside mutex?
Thanks I will take a look to this approach