Delphi 7 Intermittently unable to debug - access violation in BORdbk70.dll - delphi

At seemingly random intervals, I encounter the following error when attempting to debug programs in Delphi 7:
The only way get rid of this error is to close and reopen Delphi and even when I do this I normally see the error again fairly quickly. Restarting my computer can sometimes be useful in stopping the problem from appearing for a while.
To be clear, I am able to compile my project, it's only when I attempt to debug that I have this problem. This seems to be the DLL responsible for debugging, which makes sense.
Delphi is running within a Windows XP SP3 Environment.

insert delphi installer cd, run install and chose repair.

Related

Delphi Tokyo Debug: "A debugger has been found running in your system [...]" Error

When I try to use Delphi Tokyo debugging an application that uses functions of a DLL, when I run LoadLibrary, it shows a message that there is a debugger running and does not allow loading it.
A debugger has been found running in your system. Please, unload it from memory and restart your program.
I've disabled everything I could, antivirus, firewall, windows defender, etc ...
The DLL Manufacturer says it has no debug lock.
My suspicion may be that Windows 10, after some update, installed some mechanism to block this type of debug with LoadLibray.
Thank you guys for all help, although the manufacturer says it had no hang in the dll, I was insistent with the developers and they assumed there was a DLL problem made in C. We returned the previous version of the DLL and it worked. Thanks again.

C++ Builder: Abnormal program termination. How to investigate?

I'm trying to move a project that was done in a previous version of C++Builder to 10.1 Berlin (I am using the trial version of C++Builder).
The project was converted and compiled succefully with minimal efforts. Then I got the well-known linker LME288 problem, but it was resolved by starting C++Builder as an administrator.
But now, when I start the application, I get a message box saying "Abnormal program termination" at the very beginning - even before the main window appears on screen.
The situation is the same for debug and release versions, under IDE and as standalone. When I start the program inside the IDE, and set a breakpoint at the very first statement, the error message appears before this statement.
I have Windows 10 Pro, 64-bit. C++Builer 10.1 Berlin trial. It shows the only accessible platform is Win32, but I don't know if this is a reason for an error. The program worked fine for previous versions.
Could anybody advise me what to do? Is there a systematic way of investigating the problem?
I have tried all recommendations I could found - use debugger, show us the code, try reinstalling software or Windows, upgrade to latest updates, etc. But I have never seen a systematic approach.
Here are a couple of things I had to do to get my project working.
1) Start a new project. For some reason old projects can get corrupted and produce strange errors. I recommend starting a new project and adding your files to it.
2) Use an old version of borlndmm.dll The version provided with C++ Builder 10 produced crashes for me that made no sense. I overwrote the provided copy of borlndmm.dll with a copy from XE6 or XE8. That solved my problem.
Hopefully one of these will help you.

Delphi 7 coreide70.bpl access violation

Delphi 7 has been running fine for a long time (months on this machine, many years on others.)
However, although I know of nothing that I changed (and certainly didn't install any components) if I try to run a newly created, simple program, with one form, while I'm in the IDE, I get an Access Violation at address 006DDDC2 in coreide70.bpl.
The program runs fine outside the IDE.
I'm running no add-ins (like Delphi Speedup...)
Other than completely ripping and re-installing, any suggestions?
A rip and re-install solved the problem ... for a while, and then it re-surfaced.
For anyone having the same problem, I have traced this down to something being corrupted in my saved desktops. Since the problem was occurring when I tried to run a program, it would naturally switch to the debug desktop. Apparently it was corrupted. Saving a new desktop to replace the old desktop resolved the problem.
The first thing to try is to remove packages from the IDE. Try this out with your vanilla empty app rather than your real app. If that doesn't help I'd move straight to a Delphi reinstall. That really ought to fix it and there's probably nothing to be gained trying to solve the problem with a reinstall.

Fatal error starting debugging kernel every other deployment on Mac

I'm writing a FireMonkey HD application on my Windows 32 bits machine, and deploying (remote debugging) it on my MacBook running Snow Leopard. I'm running the Delphi XE2 Trial.
Everything is working fine, except for one thing: every other run I hit the following error when I press F9:
Fatal error starting debugging kernel: "Invalid debugger request".
Please save your work and restart Delphi XE2.
Restarting XE2 and running again cures this problem... for exactly one run, then I hit the same error again. Whether I stop the debugging run through CTRL-F2, or gracefully close the application on the Mac, makes no difference. It happens on every project (including new, empty ones with only a single FireMonkey form).The PAServer terminal has no information, it's still on "listen".
Anyone has any tips on how to avoid this issue?
Installing the full version of Delphi XE2 (including update 1) seems to have fully solved my problem.
I've checked the Bug Fix list for any references, but no such luck. Oh well, problem is gone anyway.
[EDIT] And now, the very next day, the problem re-appears.
Delphi 10 gives a similar adventure (Win32 --> Win32 target). It's "business as usual" for the remote debugger.

How do I trace an intermittent crash that occurs only under the debugger, but is not caught by it?

I have an odd intermittent crash that only occurs under some circumstances that I am having trouble solving, and I'm seeking SO's advice for how to tackle it.
The bug
At apparently random points, Windows shows the "[App] has stopped working" dialog. It is an APPCRASH in ntdll.dll, exception code 4000001f, exception offset 000a2562. Here's where it gets tricky: this only occurs when running the application under the debugger. However, the debugger does not catch this exception, and at the point where Windows shows this dialog, the IDE is not responding. This bug does not occur when running normally, i.e. not within the IDE debugger.
I can't reproduce it outside the debugger, so I can't run the program and attach when it's already crashed. I can't pause execution when Windows shows this dialog, since the IDE isn't responding. I can manually trace through lines of code to see where it occurs. There are several, and where it occurs is apparently random. For a while it occurred when showing a window (or new form), for a while when creating a thread.
Edit: I have tracked it down to the IDE: if I pause on a breakpoint and click the Thread Status tab, the program will crash immediately with the above dialog even though it is, theoretically, paused. In this situation, the IDE remains responsive. This is really weird.
More information
I have just moved my development environment to VMWare Fusion. The bug also occurs running a build from my old (native Windows) computer on my new computer; it did not occur with the same EXE file on that old computer. This makes me wonder if it is related to Fusion or something in my new setup.
I am running:
Windows 7 Pro x64 on WMWare Fusion 3.1.3 on OSX Lion 10.7.1, all fully updated. Fusion is running in "Full screen" mode on one of my screens.
A colleague running Windows 7 natively (not in a VM) does not encounter this issue. Nor did I on my old Vista computer.
Embarcadero RAD Studio 2010, fully updated (I hope; there are about five updates and getting them all in order is tricky.) I have DDevExtensions 2.4.1 installed, and the latest IDE Fix Pack too: uninstalling both these has no effect.
The application is written mostly in C++, with snippets of Delphi. It is 32-bit.
We use EurekaLog, but the exception is not caught by it either. (Normally, an exception would be caught first by the debugger, then by EurekaLog.)
Running a debug build (no EurekaLog, extra debug info etc, debug DCUs set to true) also reproduces it. However, the "Debug DCUs" option on The Delphi Linking page of the C++Builder project settings dialog seems to have no effect - I can't step into the VCL code and find the line that actually triggers the error.
Codeguard (which detects memory access errors, double frees, access in freed memory, buffer overruns, etc) reports nothing.
This has all the hallmarks of a memory corruption. It only appears when you run under a one particular environment, and occurs at a different location each time. Both classic symptoms.
The best way I know to debug this is to download the full FastMM and run with full debugging options enabled.
If that doesn't help then you are reduced to removing parts of code, one by one, until you can isolate the problem.
Another problem I have seen in D2010 is a problem when mixing local class definitions (i.e. class inside class) with generics. The code generated is fine but the debug DCUs are wrong and when stepping through the code the debugger jumps to the wrong file and dies shortly after. You don't seem to have quite the same problem but there are similarities in the IDE deaths.
Finally I would advise you to suspect your own code rather than VMware. It's always tempting to blame something else but in my experience, whenever I have done so, it was always my code in the end!
I hit a quite similar problem. I've also been developing a .dll and when I've set a breakpoint anywhere in my code, Delphi stopped at the source code line and the host-application crashed immediately.
Closing the "Thread Status Window" in debug layout "fixed" the problem.
I'm working on Windows 7 64-bit and Delphi XE3.
4000001F is STATUS_WX86_BREAKPOINT
In other words, it is INT 3, which was not handled by IDE.
Since it is raised in NTDLL - I would guess that this is indication of memory corruption in system heap. Remember, some Windows code would switch to debugger version when running under debugger. That's why you can not reproduce this when application is running as standalone outside of the debugger - because breakpoint is not generated.
You may try FastMM in full debug mode, but I do not think that it will help you. The corruption does not happen in your memory, it happens in system memory. Yes, perhaps memory allocation scheme will be changed - and your corruption will reveal itself in your code/memory... may be. Try use top-down allocations, try use SafeMM...
Another possible approach would be using Application Verifier.
See also:
Windows has generated a breakpoint
C++ error on Ms Visual Studio: "Windows has triggered a breakpoint in javaw.exe"
http://blogs.msdn.com/b/oldnewthing/archive/2012/01/25/10260334.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2013/12/27/10484882.aspx
Check the The projects dsk file and make sure it does not have a reference pointing to the wrong unit. The fix is to open the dsk in an editor and change the file location to the correct location.

Resources