MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000210JANABugpublic2012-03-21 10:582012-03-21 11:49
Reporterdavidl 
Assigned Todavidl 
PrioritynormalSeveritymajorReproducibilitysometimes
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000210: program hangs when merging threads at end
DescriptionA JANA program can hang at the end of processing just after printing a message like: "Merging thread 0".

The reason for this is because the JEventLoop destructor calls RemoveJEventLoop which adds the thread to the "threads_to_be_joined" vector. If this happens while the main (monitoring) thread is inside of the application mutex lock, it can call pthread_join while the mutex is locked. Meanwhile, the JEventLoop destructor tries calling JApplication::AddFactoriesToDeleteList(). This tries locking the application mutex, but can't since it is already locked by the main thread. Thus, the JEventLoop destructor never exits and consequently, pthread_exit is never called making pthread_join block forever.

One solution for this would be to create a separate mutex for controlling access to the factories_to_delete container.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000315)
davidl (administrator)
2012-03-21 11:49

I added a factories_to_delete_mutex to JApplication that is used to synchronize access to the factories_to_delete vector. No testing has been done yet to confirm that this actually solves the problem (but it should!)

- Issue History
Date Modified Username Field Change
2012-03-21 10:58 davidl New Issue
2012-03-21 11:49 davidl Note Added: 0000315
2012-03-21 11:49 davidl Status new => resolved
2012-03-21 11:49 davidl Resolution open => fixed
2012-03-21 11:49 davidl Assigned To => davidl


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker