Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
IDE
Add Component Template
Background compile
Batch file target
Block Completion
Build Tools
Caliber
Class Completion
Class Explorer
Code Browsing
Code Completion
Code Editor
Code Explorer
Code Parameters
Code Templates
Compiler Message Window
Deployment Manager
Dialogs
Direct
Docking
File Browser
File Handling
Form Designer
Help
History View
IDE Insight
Memory Issues
Menu Designer
Menus
Module Manager
Multi-Monitor Support
Object Inspector
Object TreeView
Open Tools API
Packages
Performance
Printing
Project Explorer(old Object Browser)
Project Management
Refactoring
Repository
Save Desktop
Search
Start Page
Starteam
Startup/Shutdown
Structure Pane
System Resources
ToDoList
Tool Palette
Toolbars/Status Line
Translation Tools
Unit Testing
Version Control
VersionInfo
Views
Visual Form Inheritance
Workgroup(PVCS)
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/IDE/Save Desktop
[ Add a report in this area ]
Report #:
61289
Status:
Closed
Improper use of TThead.Suspend in LoadDesktop
Project:
Delphi
Build #:
11.0.2902.10471
Version:
11.2
Submitted By:
Sebastian Zierer
Report Type:
Crash / Data loss / Total failure
Date Reported:
4/22/2008 11:08:28 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
259621
Resolution:
Fixed
(Resolution Comments)
Resolved in Build:
:
12.0.3136.15942
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
10
Description
When trying to debug a program Delphi came up with an exception in Thread.Suspend. I was surprised to find that call in the call stack of LoadDesktop because when using that function you'll very likely run into deadlocks and access violations. Please use a proper synchronisation object instead of SuspendThread.
Apart from the warnings in the Platform SDK:
If the thread that is to be suspended happens to be suspended while using the heap, you will deadlock. Remember that the heap is a threadsafe object. In that case the thread might own a critical section or another synchronization object.
2003f2d3 +03f rtl100.bpl Classes 10236 +5 Classes.TThread.Suspend
209df443 +01b coreide100.bpl Desktop 1493 +1 Desktop.TDesktopStates.LoadDesktop
209df5c4 +06c coreide100.bpl Desktop 1553 +9 Desktop.TDesktopStates.LoadRuntimeDesktop
209df756 +03a coreide100.bpl Desktop 1582 +4 Desktop.TDesktopStates.ProcessCreated
I'm sure that this will be the reason for a deadlock in the IDE.
Windows SDK:
This function is primarily designed for use by debuggers. It is not intended to be used for thread synchronization. Calling SuspendThread on a thread that owns a synchronization object, such as a mutex or critical section, can lead to a deadlock if the calling thread tries to obtain a synchronization object owned by a suspended thread.
Steps to Reproduce:
Attach a debugger to the IDE, set a breakpoing in TThread.Suspend. Then switch the IDE Desktop or start debugging a program. TThread.Suspend should not be called.
Workarounds
None
Attachment
None
Comments
Markus Humm at 4/22/2008 11:17:39 PM
-
Marked as needs attention
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us