How to track intermittent failure that occurs only under the debugger but not caught?

I have an odd intermittent failure that occurs only under certain circumstances , that I have problems with solving the problem, and I am looking for SO advice on how to solve it.

Mistake

At clearly random points, Windows indicates that the "[App] has stopped working." This is APPCRASH in the ntdll.dll file, exception code 4000001f, exception 000a2562. Here, where it becomes difficult: this only happens when the application starts under the debugger. However, the debugger will not catch this exception, and the moment the Windows displays this dialog box, the IDE does not respond. This error does not occur during normal operation, that is, not in the IDE debugger.

Screenshot of the Windows crash dialog

I can’t play it outside the debugger, so I can’t start the program and attach it when it has already crashed. I cannot pause execution when Windows displays this dialog box because the IDE is not responding. I can manually trace the lines of code to see where this happens. There are several of them, and where this seems to be random. For some time this happened when showing a window (or a new form) for a while when creating a stream.

Edit: I tracked it to the IDE: if I stop at the breakpoint and go to the "Theme Status" tab, the program will immediately work using the above dialog, although this is theoretically suspended. In this situation, the IDE remains responsive. This is really weird.

Additional Information

I just migrated my development environment to VMWare Fusion . The error also occurs when starting the build from my old (native Windows) computer on my new computer; this did not happen with the same exe file on this old computer. This makes me wonder if this is related to Fusion or something in my new setup.

I run:

  • Windows 7 Pro x64 on WMWare Fusion 3.1.3 on OSX Lion 10.7.1, all fully updated. Fusion works in Full Screen mode on one of my screens.
  • An employee running Windows 7 (not in a virtual machine) does not encounter this problem. I am also not on my old Vista computer.
  • Embarcadero RAD Studio 2010, completely updated (I hope there are about five updates and all of them are in order difficult). I have DDevExtensions 2.4.1 installed, as well as the latest IDE fix pack: deleting both of these files has no effect.
  • The application is written mainly in C ++, with Delphi fragments. It is 32-bit.
  • We use EurekaLog , but the exception is not caught either. (Typically, the exception would be caught first by the debugger, then by EurekaLog.)
  • Performing a debug build (without EurekaLog, additional debugging information, etc., DCU debugging set to true) also plays it. However, the "Debug DCUs" option on the "Delphi Binding" page of the C ++ Builder Project Settings dialog box has no effect - I cannot enter the VCL code and find the line that actually causes the error.
  • Codeguard (which detects memory access errors, double releases, free memory access, buffer overflows, etc.) reports nothing.
+8
delphi vmware-fusion crash c ++ builder
source share
4 answers

It has all the signs of memory corruption. It appears only when launched in one specific environment and occurs each time in a different place. Both are classic symptoms.

The best way I know for debugging is to download the full version of FastMM and run it with the full debugging options turned on.

If this does not help you, you will reduce it to part of the code, one by one, until you can isolate the problem.

Another problem that I saw in D2010 is the problem of mixing local class definitions (i.e. a class inside a class) with generics. The generated code is good, but the debugging DCUs are wrong, and when you go through the code, the debugger goes to the wrong file and dies soon. You don't seem to have the same problem, but there are similarities in the fatal cases of the IDE.

Finally, I would advise you to suspect your own code, not VMware. It's always tempting to blame for something else, but in my experience, whenever I did, it was always my code at the end!

+8
source share

I ran into a similar problem. I am also developing a .dll, and when I set a breakpoint anywhere in my code, Delphi stopped at the source line and the host application immediately worked.

Closing the "stream status window" in the debug layout "fixed" the problem. I am working on a 64 bit version of Windows 7 and Delphi XE3.

+3
source share

4000001F - STATUS_WX86_BREAKPOINT

In other words, this is INT 3, which was not handled by the IDE.

Since it is raised in NTDLL - I would suggest that this is an indication of memory corruption in the system heap. Remember that some Windows codes switch to the debugger version when working in the debugger. This is why you cannot reproduce this when the application runs as standalone outside the debugger because a breakpoint is not generated.

You can try FastMM in full debug mode, but I don’t think it will help you. Corruption does not occur in your memory, it occurs in system memory. Yes, maybe the memory allocation scheme will be changed - and your corruption will appear in your code / memory ... maybe. Try using top-down distributions, try using SafeMM ...

Another possible approach would be to use Application Verifier .

See also:

+2
source share

Check the dasks project file and make sure it does not have a link pointing to the wrong block. The fix is ​​to open dsk in the editor and change the location of the file in the right place.

+1
source share

All Articles