• Advertisement
Sign in to follow this  

"Free Heap block modified at after it was freed" in asCScriptEngine::Release

This topic is 2161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HEAP[hoge.exe]: HEAP: Free Heap block a69bf78 modified at a69bfb0 after it was freed

With AngelScript 2.23.0, my app shows this message before going asCScriptEngine's destructor.
This error is not shown with previous version(2.21.1).
How can I fix this problem? It's seems to difficult to post a program that produces same error.

Share this post


Link to post
Share on other sites
Advertisement
Maybe it is an error in their new version, or maybe there is something in your code that was working but not it needs to change. You could get the source code of AngelScript, compile it and debug the execution of the script through it to check where that happens.

Share this post


Link to post
Share on other sites
We might need more data, such as where the error is actually occurring. That error crops up when you write to a pointer after it has been freed.

Share this post


Link to post
Share on other sites
There is obviously a problem with memory being modified after it was deallocated. This is usually caused by 'dangling pointers', and is something that reference counting attempts to prevent, as memory isn't deallocated while there are still references to it.

Whether this is a bug in AngelScript or your own application is impossible to say without further information.

Does the problem always happen, or is it intermittent? If it always happens, does it always happen at the same addresses? If it always happens at the same addresses you can set a memory break point at that address to catch the code that is actually making the invalid modification.

If the problem is intermittent or the addresses reported varies, then it will be much more difficult to catch. There are tools available that can help, both free and paid versions. Here's a couple of free tools I recommend trying:

- valgrind is an excellent tool for runtime checking memory management and would most likely be able to catch this problem. It's open source, but unfortunately I don't think it is readily available for Windows.
- cppcheck is an open source static code analyser that may be point the possible cause. This one is available for Windows.

A couple of comercial versions that I know of are Purify, Bullseye, and also Microsoft's analyze that comes with the professional version of MSVC. There might be trial versions available for these that you can try out, unless you have access to the real deal.

Share this post


Link to post
Share on other sites
Using _CrtCheckMemory(),?I finally found a problem in source code of my application.
It accessed a property of object after deletion. It was not a problem in AngelScript.
Thank you for asking.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement