login about faq

I don't have an answer for this yet, but I've narrowed down a real issue with including ChilKat DLL into DelphiXE6 projects when you also use UPX executable packer on the exe. I haven't tried any other versions of Delphi to confirm if this applies to all versions.

If you compile the Delphi project exe with Debug Information linked, the packed exe works fine. If you turn off the option for Debug Information then the exe will hang when you run it. I created a small demo application to remove everything else from the project. We've been using UPX for a decade or more, and building our release version of projects without debug info for longer. The only new thing introduced here was ChilKat.

I don't know if anyone has a solution for this, or anything can be done. But I thought I'd share this information to hopefully save others the days I've spent narrowing down on what was happening.

asked Oct 17 '16 at 09:56

rjwerning's gravatar image


I ran into a similar problem with Chilkat after using UPX for many years. Unfortunately I never found a solution or workaround. However, after switching to PECompact, I no longer experience the problem and I recommend using PECompact instead.


answered Oct 17 '16 at 12:02

therat's gravatar image


I suspected the problem had to do with the way that ChilKat is loaded statically, this was a variation from the other DLL's that we use (3p & internal created). UPX does an uncompress once it's loaded into memory, so I figured that the memory address of the ChilKat dll procs were being trashed.

After reading another forum post (http://www.chilkatforum.com/questions/11058/delphi-dll-version-static-dll-names) I spent an hour or so rewriting the parts of Crypt2.pas that we need, to handle dynamic loading upon first request and then in the finalization it unloads if the DLL has been loaded. Rebuild of demo app without debugging information & doing UPX on the exe no longer causes the application to hang.

I'd recommend that the Delphi units are rewritten to handle dynamic loading of the DLL, as suggested in the other post.

  • Rich

answered Oct 17 '16 at 13:02

rjwerning's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Oct 17 '16 at 09:56

Seen: 1,712 times

Last updated: Oct 17 '16 at 13:02

powered by OSQA