0

I migrated my working project from VS2013 to VS2015.
I got an error just at the beginning, before application starts, before main.
I am able to compile but ... while debugging just before application starts I receive:

Exception thrown at 0x77a20126 in opctcp_v1.exe: 0xC0000005:

Access violation reading location 0x6f865e77.
Debug Assertion Failed!

Program: D:\ (...) \Debug\opctcp_v1.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: 1037

Expression: _CrtIsValidHeapPointer(block)

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

I was looking on google for an answer. I already use VS2015.1

Do you have any idea, how to make it run? Any project option? Or is it just VS2015 bug?
EDIT 1:
This project still works/debug fine under VS2013.
EDIT 2:
I know how to debug. Problem is that [Start debugging] cause this error what means it can not even reach function 'int main(array ^args)' !. Nothing has changed in the whole program.
EDIT 3:
Screenshot 1 EDIT 4:
Screenshot 2

MrHIDEn
  • 1,723
  • 1
  • 25
  • 23
  • 1
    It's probably a lot more informative to see the entire call stack. Chances seem high that something in your startup (static class constructor? not sure) could be triggering it. Chances seem low that this is a VS2015 bug. – Alan McBee Dec 17 '15 at 08:09
  • What Alan said: likely there is a bug in your code which only gets triggered by accident and which does so under VS2015. Just run your app under the debugger and see what happens; as it stands there is no other answer anyone can provide here because of http://stackoverflow.com/help/mcve – stijn Dec 17 '15 at 08:58
  • @stijn Debugging is pretty easy but I can not debug it because when application starts this failure appeared. Just when app starts. – MrHIDEn Dec 17 '15 at 09:21
  • It is not trivial issue, that's why I posted it. – MrHIDEn Dec 17 '15 at 09:28
  • So you cannot debug it even when you start with F10? Or if you select to debug in the Debug assertion dialog (after all, that is what it's meant for)? – stijn Dec 17 '15 at 09:29
  • F10 raises this error. – MrHIDEn Dec 17 '15 at 09:32
  • Yeah that's why I added the second suggestion: hit retry to attach the debugger. – stijn Dec 17 '15 at 10:04
  • Another window appeared "opctcp_v1.exe has triggered a breakpoint". Break or Continue? – MrHIDEn Dec 17 '15 at 10:14
  • Break -> "ucrtbased.pdb not loaded" – MrHIDEn Dec 17 '15 at 10:15
  • *ucrtbased.pdb not loaded* doesn't matter. You have to look in the callstak and go back to figure out which call eventually triggered the assertion – stijn Dec 17 '15 at 11:00
  • Take a look on EDIT 4, please. – MrHIDEn Dec 17 '15 at 11:42
  • The interesting part might be more near the bottom of the callstack in the part not shown - is it invoked by something in your code like static initializers or so? Then again, without actual code to reproduce the problem it's hard to tell more. – stijn Dec 17 '15 at 16:09
  • I got sample C++ Windows Forms application. I removed original classes and I left only empty "int main(..." with return 0. Than I "connected" my classes and main code, compiled and !! it works !! I left original project settings. I of course have tried compare my config with downloaded config, but it looks pretty the same... It took me almost 2 days. I wish I can tell what was wrong. I will take another look on configs tomorrow. THX for support. – MrHIDEn Dec 17 '15 at 16:17
  • Maybe some static class with auto constructor did that, but I did not change the code and now it works. – MrHIDEn Dec 17 '15 at 16:24
  • You might want to take a look at my question (solved) here: http://stackoverflow.com/questions/35575805/afxwin-h-issues-in-visual-studio-2015-windows-form-app – Fabius Feb 23 '16 at 16:46

0 Answers0