Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Debugger/Execution    [ Add a report in this area ]  
Report #:  116562   Status: Open
[x64] Debugging DLL and EXE in XE4
Project:  C++Builder Build #:  18.0.4905.60485
Version:    18.0 Submitted By:   Michael Davis
Report Type:  Basic functionality failure Date Reported:  6/14/2013 11:45:15 AM
Severity:    Critical / Show Stopper Last Updated: 1/8/2014 5:40:13 PM
Platform:    All versions Internal Tracking #:   40064
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (3 Total Ratings)
5.00 out of 5
Total Votes: 15
Description
My application has both an EXE and DLL. When I run the debugger (in the IDE), all works correctly until I exit the debugger and recompile. When I attempt to recompile either the DLL or EXE, the process gets an error 1224 (could not open the dll or exe). The reason is that the dll and/or exe is still open and the processing cannot replace the open file. For a while, I was able to get around this problem by "killing" the dbk64_18_0.exe that had the most memory (there are two of them). Once I did this, I could recompile and run. I would get a "disconnected session" error message, but I would just run again and all would be okay. A slight inconvenience, but nothing to really worry about. Two extra keystrokes.

I still have this problem, but now I am unconditionally getting another error message after I used my corrective technique (kill the exe and recompile). When I attempt to rerun after I get the "disconnected session" error message, I now a new error "Fatal error starting debugger kernel: "Invalid Debugger Request". The message indicates that I should save everything and shut down C++ Builder XE4.

This new issue is very inconvenient. It means that for any one execution of C++ Builder XE4, I get to test the changes only one time before I have to shut down and restart the C++ Builder. Needless to say, incremental change / debugging is now very cumbersome as it requires restarting C++ Builder each time.
Steps to Reproduce:
1. Create a project group with a DLL and EXE.

2. Compile and run a test.

3. Recompile a module and try to link it. It will fail.
Workarounds
None
Attachment
Debug Testcase.zip
Comments

Tomohiro Takahashi at 6/15/2013 12:29:52 AM -
Could you please attach sample projects(.exe and .dll) to reproduce your issue?

Michael Davis at 6/17/2013 10:54:47 AM -
I am attaching the project group that I am trying to get going. It is a small part of my entire application, but it is the one that has the problem. There are warnings as I have not converted to 64bit as yet. The warnings should not cause any trouble.

Once you load it, build the DLL and then the EXE. Run the application. There is a button and once clicked will cause a fault. You can allow it to continue if you wish, but it is not necessary. You can end the debugger with the Ctrl-F2 key. At this point, recompile any one of the units in the DLL and then relink it. You should get the following error:

[ilink64 Error] Fatal: Could not open ..\Release\Win64\DLLKernel.dll (error code 1224)

If you terminate the dbk64_18_0.exe with the most memory in use, you will then be able to relink the DLL, At this point you might be able to restart the Debugger (F9), but you should get a "disconnected session" message. Close this message, and restart the Debugger (F9). You will either be able to run (as I used to be able to), or you will get a debugger start error and you will need to shut down the IDE.

Please be aware that I am running Windows 8 and this may be part of the problem.

Michael Kegler at 1/8/2014 6:35:44 AM -
Hello,

use you FreeLibrary()-Function by closing the Application?

ko f at 5/18/2014 9:01:25 AM -
I'm facing exactly same problem in all of my x64 projects. It happen every time when make changes to the code and rebuild the project. After recompiled, it always has the following linker error:

[ilink64 Error] Fatal: Could not open X:\Project1\Project1.exe (error code 1224)

It seems that this bug still exists in XE5, has it been fixed in XE6?

Mike Versteeg at 3/16/2015 8:04:32 AM -
Still present in XE7! Workaround is to close CB, delete the exe and then restart CB.

Server Response from: ETNACODE01