Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:09:23+00:00 2026-05-27T13:09:23+00:00

I am not sure how to track down the following crash: It happens when

  • 0

I am not sure how to track down the following crash:

  1. It happens when Unloading a Designtime Package that is used in-house at my company. It is our code, thus it is our bug to fix, not a third party component vendor problem.

  2. It apppears that a thread is involved, but since it happens in the Function ThreadProc in Classes.pas, I’m guessing it’s a bare System/RTL thread without even a TThread class wrapper that I should be searching for in our code. (Question Part A: Is that so?)

  3. The call stack contains none of my code, only the IDE itself, and the base function in the call stack is ntdll.RtlInitializeExceptionChain.

call stack example of an access violation in some TThread.Execute method that shows that the debugger gives no details on WHICH thread is involved:

 :7599b9bc KERNELBASE.RaiseException + 0x58
 :516b4965 ; c:\program files (x86)\embarcadero\rad studio\8.0\bin\exceptiondiag150.bpl
 :5003b058 NotifyNonDelphiException + $1C
 :77be6a8b ; ntdll.dll
 :77bb0143 ntdll.KiUserExceptionDispatcher + 0xf
 rtl.Classes.ThreadProc($CB9ED70)
rtl.System.ThreadWrapper($403E910)
:75fb339a kernel32.BaseThreadInitThunk + 0x12
:77bd9ed2 ntdll.RtlInitializeExceptionChain + 0x63
:77bd9ea5 ntdll.RtlInitializeExceptionChain + 0x36

When I try to view thread info, the second Delphi IDE that is my target executable, itself crashes, but I am able to continue to view information in my delphi debug host instance.

I am aware of techniques for debugging designtime packages, and I am using said techniques. That is, I have a first copy of delphi (BDS.exe) launching a second copy, because the package project, has set in its Run Parameters, in the Host Application edit box the main bds.exe for Delphi XE. (C:\Program Files (x86)\Embarcadero\RAD Studio\8.0\bin\bds.exe). Thus when I run my package in debug mode, it loads itself into the Delphi IDE.

Question part B is: What is the best place to set a breakpoint so I can see non-TThread threads, as well as TThread-based threads being created? If there is no way to set a breakpoint, then how about an alternative means of finding what code is creating threads?

Update: I have found that setting a breakpoint in the line that reads Thread.Execute, in function ThreadProc, in Classes.pas, gets me a breakpoint hit on each TThread startup. That is enough to find threads started by a designtime or runtime package from its initialization section, but I’m hoping there exists an even lower level way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:09:24+00:00Added an answer on May 27, 2026 at 1:09 pm

    I debugged the designtime package crash in the following manner:

    1. As already noted above, set up Delphi to run itself, using Run Parameters, in the Host Application, the path is c:\path-to-delphi-install\bin\bds.exe.

    2. Set a breakpoint in the line in function ThreadProc in System.pas.

    3. Open windows.pas, and around line 30,000-33,000 there is a line like this:

      function CreateThread; external kernel32 name 'CreateThread';

    Set a breakpoint on the line above with F8. Now when anything in the code being debugged invokes that Win32 function, whether via TThread or not, you’ll get a breakpoint.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if this question makes for some poor performance down the track, but
I've got a strange bug I'm not sure how to track down. I'm running
Im not sure why I am recieving this error, and I'm unable to track
Trying to track down some memory leaks in our WPF/MVVM app and something occurred
From: http://developers.soundcloud.com/docs/api/tracks#filtering I'm not sure from the docs if this functionality is available. I
Not sure whats going on here, or what could be the integer in this
Not sure if im just being stupid or something but here goes i work
Not sure how to ask this, but i'll give it a try: I have
Not sure if this is a big deal. But wondering why when the site
not sure what I'm missing here, but i keep getting the error. SQLSTATE[HY093]: Invalid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.