C # / C ++ application crashes when starting from Windows but not from Visual Studio

I am developing a C # application that calls an unmanaged (C ++) dll. I found a specific user operation that sequentially causes the application to crash when starting from Windows Explorer. However, when starting from the Visual Studio debugger, the crash does not occur. Therefore, I cannot enter the code during the crash and debug what happens.

What can cause a binary file to crash when launched from Explorer, but not from Visual Studio? Note that I am using the Release assembly; Debugging fails in Visual Studio or Explorer.

(If this is relevant, I can say that the accident is related to manipulating the allocated malloc array in the C ++ DLL. I tracked it, carefully commenting on the blocks of code, rebuilding, starting from Windows and checking whether the crash occurs. However, I reached the point, when it’s very difficult to continue working without being able to properly break the debugger).

I'm just interested in the ability to recreate a crash in Visual Studio.

+4
source share
1 answer

When the program runs in debugging but the release fails, the problem is actually often buffer overflowed, so you should look for something like the wrong variable buffer length.

, , . , , . , , malloc-ed, .

, , , , . DLL , DLL- DLL. , , , , .

, , . undefined .

: , , , _NO_DEBUG_HEAP = 1. ( ).

+6

Source: https://habr.com/ru/post/1570267/


All Articles