Cycling74 / min-devkit

Tools, documentation, and reference implementation of a Max Package built using the Min-API.
MIT License
161 stars 31 forks source link

Debug Heap exception during Debugging #201

Open mourendxu opened 2 years ago

mourendxu commented 2 years ago

I am trying to debug some of my objects written using the min dev kit. And I keep getting these debug heap errors, ONLY when starting or exiting Max. Why is this happening? Is there something I am not cleaning up or?

File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp Line: 996

Thank you!

isabelgk commented 2 years ago

Can you give some more information about your system, what the actual error logs are, etc.?

Thanks!

mourendxu commented 2 years ago

Hi finally got the error again: Debug Assertion Failed

Program: (my object) File: minkernel\crts\ucrf\src\appcrf\heap\debug_heap.cpp Line: 996 Expression: __acrt_first_block == header

mourendxu commented 2 years ago

Sorry, forgot to add Windows 10 latest update, Visual Studio 2019 Version 16.11.10

mourendxu commented 2 years ago

I am also getting exception here, in debug_heap.cpp, Line 1406 extern "C" int __cdecl _CrtIsValidHeapPointer(void const* const block) { if (!block) return FALSE;

return HeapValidate(__acrt_heap, 0, header_from_block(block));

}

isabelgk commented 2 years ago

Thanks for the followup!

To narrow it down to whether this is an issue with the min-api or your particular object, does this error happen when trying to debug any of the min-devkit example objects?

mourendxu commented 2 years ago

Hi, Thank you for the reply. So, it seems to pop up just running Max in Debug mode in visual studio. I start my debug session with no patch indicated. It loads just Max. And this error popped up several times simply just on initialization. Therefore, I don't think? it's my code. It's not persistent either. After several restarts, it will just go away. Or it will show up when I exit Max. I would close the Max patch, then exit. I see in the console that my object has exited(the destructor has been called).

Does that help? Please let me know if you need info from me.

Thank you.

isabelgk commented 2 years ago

Thanks, yes, that's helpful. What version of Max are you using?

mourendxu commented 2 years ago

I believe I am running the latest, which is 8.2.1.

Thank you.