Application throws exception without debugger attached

I've got a kind of curious problem here, and to be quite honest I have no idea what's causing it. For whatever reason, when I debug my application from Qt Creator my application runs just fine without any exceptions, but when I only run the application, I get a write access violation exception (as follows)

(1f68.1ea8): Access violation - code c0000005 (first chance)

Exception at 0x77da2073, code: 0xc0000005: write access violation at: 0x1, flags=0x0 in ntdll!RtlpLowFragHeapFree

First chance exceptions are reported before any exception handling.

This exception may be expected and handled.

eax=00720065 ebx=82130074 ecx=006f007f edx=0000006f esi=01fa5fb6 edi=82130000 eip=77da2073 esp=0012cc70 ebp=0012cca4 iopl=0 nv up ei pl nz na po nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202

ntdll!RtlpLowFragHeapFree+0xc5: 77da2073 8930 mov dword ptr [eax],esi ds:0023:00720065=????????

Exception at 0x77da2073, code: 0xc0000005: write access violation at: 0x1, flags=0x0

NOTE: INFERIOR SPONTANEOUS STOP

State changed from InferiorRunOk(11) to InferiorStopOk(14).

When I comment out the line it breaks at (after running, then manually attaching the debugger) it just seems to bring me to a different line for the same issue. The tool chain I'm using is MSVCC, with the additional flags:

QMAKE_CFLAGS_RELEASE += -Zi

QMAKE_CXXFLAGS_RELEASE += -Zi -g

QMAKE_LFLAGS_RELEASE += /DEBUG /OPT:REF

To recount, here's what I've tried:

  • Debugging with debug configuration - ok
  • Running with debug configuration - ok
  • Debugging with release configuration - ok
  • Running with release configuration - exception

  • Are you double freeing something? A quick search brings up this article about double freeing.

    I'm not sure what the MSVCC equivalent might be (the article mentions a tool called gflags.exe ), but under Linux with GCC you can use a program called Valgrind with the memcheck tool to find this sort of problem.

    链接地址: http://www.djcxy.com/p/86830.html

    上一篇: 访问冲突(未处理的异常)

    下一篇: 应用程序抛出异常没有附加调试器