![]() |
Finding leaks
I recently discovered a leak of some kind in Fritz. It doesn't do it always, and usually only after a while. It always crashes in the .exe, with an error msg about "referencing memory that could not be read".
I've run Fritz with various monitors running, and the Private Bytes count and the Handle counts for the game never increase, so I'm wondering if anyone with some C experience has some ideas where would be the "usual suspects" to look for. I've checked my pointers and strucs, they all look good. I don't alloc any memory, don't play around with the game's internal pointers/strucs (much.....). Its the randomness of the crash, and the fact that no memory or handles are used, that really confuses me ATM. ???:( |
Re: Finding leaks
mostly its with indexes. Ie:
Code:
Code:
|
Re: Finding leaks
I had very nasty bug in my bot recently. It ran fine on release mode, however it crashed in debug mode. It crashed bit randomly and after some specific sequence of commands.
Nevermind I said, I'll set breakpoints and I'll find out the problem. However when hl ran under debugger, there was no crash. Nevermind I said, I have pretty cool logging system in my bot, I'll log code and debug it that way to find incriminated code. However I was using buffer to speed up logging and after the crash, buffer was not written to disk. Nevermind I said, I'll set buffer size to 0 and I'll see what was logged last before crash, I'd done it couple of times. However after I set it to 0, crash was gone. I was like wtf. After 4 hours I've finally found the problem. I had an array of size about 20 or so where I stored clients weapon when message came, but I didn't check bounds and one message came with index 255 9_9 After that I use std::vector whenever I can :) electric fence may help you with dynamic memory : http://perens.com/FreeSoftware/ |
Re: Finding leaks
Quote:
Quote:
http://filebase.bots-united.com/inde...on=file&id=254 |
All times are GMT +2. The time now is 00:36. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.