Strangest bug I've ever seen

There's only need for one forum for now. Discuss development. No advertising or thinly veiled attempts at advertising. Create a single thread for your project and be prepared to show and tell.
Post Reply
User avatar
Deckhead
Site Admin
Posts: 128
Joined: Fri Feb 21, 2020 5:44 am
Location: Sydney, Australia
Contact:

Re: Strangest bug I've ever seen

Post by Deckhead »

It doesn't look like you're missing anything to me.

But in the first image, I notice that you can't see the value of testWTF. In the second image I can see that testWTF is NULL but testWTF_again is seated correctly. In the first image, is testWTF also NULL?

In my experience, these sorts of errors are nearly always false-positives. Like the actual error is elsewhere in the code, you're overwriting an array, or using after free, or something; and this is just a symptom. I'm not sure what the equivalent tool on Mac is, but something like valgrind (Linux and I think Mac?), or Dr Memory (Windows/Linux) would show the original error. Google has an Address Sanitizer tool that does the same stuff.

Basically all these tools do is highjack the memory and tell you exactly where you're overwriting bounds or double deleting or something like that. They detect leaks as well.

You could also try enabling more compiler warnings. Finally, CPPCheck does a good
Developer of The Last Boundary and webmaster of IndieGameDev.net
Post Reply