Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Packages    [ Add a report in this area ]  
Report #:  95194   Status: Closed
Inifnite loop while closing the application
Project:  Delphi Build #:  15.1
Version:    15.1 Submitted By:   rahul wootla
Report Type:  Crash / Data loss / Total failure Date Reported:  6/15/2011 11:08:47 PM
Severity:    Infrequently encountered problem Last Updated: 9/22/2012 11:12:31 PM
Platform:    All versions Internal Tracking #:  
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
When closing the application, the Main thread is entering into inifinite loop in the routine CleanEventList of SysUtils.

This problem occurs at random.
Steps to Reproduce:
Create an applicaiton with run-time packages and load the packages at run time.
Close the application.

Tomohiro Takahashi at 6/16/2011 7:04:39 AM -
Could you write more detailed [Steps] and attach sample projects(package and .exe) to understand/verify your issue?

Alexandr Kravchuk at 6/30/2011 1:03:47 PM -
I'm having this problem too. And even sometime can reproduce it. I have explored why after exit my program was staying in processes (with one thread). And callstack show deadlock at line
repeat until InterlockedCompareExchange(EventCache[I].Lock, 1, 0) = 0;
But it happening not every time, at least 1 every 4-5 runs.

Tomorrow I'll try to write a little one example to reproduce

Tomohiro Takahashi at 6/30/2011 6:25:08 PM -
> Tomorrow I'll try to write a little one example to reproduce
Ok, please upload the sample project(as a .zip) to Discussion Forum. I will attach it to this report as Sysop.
[Embarcadero Discussion Forums >> Attachments]

Alexandr Kravchuk at 7/1/2011 1:20:07 AM -
This very hard to write small application which can reproduce this issue. My project is very big and when I keep only part of it, problem disappear. I think reducing my program remove some logic which causes this bug.

Please, can you describe any possible reasons which can causes infinite loop in DoneMonitorSupport.CleanEventList?

Tomohiro Takahashi at 7/2/2011 7:09:56 AM -
ok, please contact technical support service if you need more help.

Pablo Pascual at 6/21/2012 3:19:00 AM -
Same bug for me in Delphi/CBuilder XE2 trial.

Workaround for me: don't use TThreadList objects.

I have a big application with several dlls in Delphi and several dlls in C++. One of those written in C++ use intensively threads (more than 15 threads so early). Two of these threads use the TThreadList object. I have replaced this objects for  standard list objects from stdlib (in my case, std::deque) and the problem is gone out.

IMHO seems that there's a problem with TThreadList objects,  maybe with some other objects that calls SysUtils.NewSyncObj and SysUtils.FreeSyncObj directly or indirectly.

Tomohiro Takahashi at 6/21/2012 6:47:42 PM -
Could you please put new QC report about your issue?

Server Response from: ETNACODE01