0

i coded a big project in c++ that runs when I open it in Debug or Release Mode, but when i open it without Debugging (ctrl + f5) it crashs after 5 seconds. It just doesn't reply anymore and is tagged as inactive in taskmanager. I tried to analyse the error with the windows debugger tools and application verfier, but i found nothing. Even when I set the "_NO_DEBUG_HEAP=1", the error doesn't occur, it just happens when I start it with ctrl + f5 or outside from visual studio. I'm not even sure if the _NO_DEBUG_HEAP works... Anyone have an idea what could be wrong ?

Jesaya00
  • 21
  • 1
  • 3
  • What do you expect `_NO_DEBUG_HEAP` to do? Have you tried attaching a debugger to the process to see where it is? What do you mean "doesn't reply any more""? – doctorlove May 13 '15 at 08:17

2 Answers2

1

Any number of things may cause this.

Based on my passed experience, I suggest tackling this by removing code until the behaviour disappears... then determining why removing the code in question corrected the behaviour. (the removed code may not have been the cause, only a catalyst for the symptom)

If I was tasked with taking a quick glance to spot the error, I would think to look for buffer overrun related issues. This type of error has more safeguards in debug than executing a final build. That's just a stab in the dark based on buffer overruns being a common issue that kinda fits the symptom.

-dm

Duckman
  • 85
  • 2
  • 7
0

Common things to check:

Are you sure your application is setting any memory used to zero, if it is assuming the memory has to be zeroed out?

Visual Studio might be initializing the memory given to the application.

Is all the memory allocated being deallocated?

There are no un-initialized pointers being used?

There are no un-initialized variables being used?

64 bit exe crashing outside visual studio but working inside visual studio

Does the problem only happen on one computer?

You can use check_heap to check the validity of the heap in the program:

Program crashes only in Release mode outside debugger

You can use the Windows debugging tools to show heap corruption - there is a tool called "gflags" that comes with the Microsoft "Standalone Debugging Tools for Windows"

https://msdn.microsoft.com/en-us/windows/hardware/hh852365

This URL shows how to run gflags against your .EXE:

Visual Studio - how to find source of heap corruption errors

Community
  • 1
  • 1
A B
  • 4,068
  • 1
  • 20
  • 23