Opened 5 years ago

#12050 new bug

Tracker deadlock between FS unmount and DoPeriodicUpdate

Reported by: mmlr Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Tracker Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


Periodic update BPose's are ones that get updated periodically through TTracker::Pulse() like the volume icons on the desktop with their free space bars. They are kept in a list managed by a global PeriodicUpdatePoses object.

TTracker::Pulse() calls PeriodicUpdatePoses::DoPeriodicUpdate() (Utilities.cpp:222) which locks the PeriodicUpdatePoses object and then locks the looper of each BPoseView where a BPose is to be updated.

When a volume is unmounted the FS notification triggers the BPose representing the volume on the desktop to be removed and destroyed. The BPose destructor then removes itself from the list via PeriodicUpdatePoses::RemovePose() (Utilities.cpp:200). This goes through the list and when it finds the item, it locks the object and removes the BPose. Locking is broken because items are added to the list without locking and the list traversal on remove doesn't happen locked. This should be fixed as well but doesn't affect the deadlock here.

The deadlock happens when DoPeriodicUpdate already holds the lock of PeriodicUpdatePoses but hasn't yet locked the looper of the BPoseView while the FS notification is handled (which means the looper is locked) but hasn't yet caused PeriodicUpdatePoses::RemovePose() to be called.

Attached is a KDL session showing more details. As I am tracking other issues currently and am unsure how this could be fixed cleanly, I'll leave this here without intention of fixing it myself.

Attachments (1)

tracker_deadlock_on_unmount.txt (8.1 KB ) - added by mmlr 5 years ago.

Download all attachments as: .zip

Change History (1)

by mmlr, 5 years ago

Note: See TracTickets for help on using tickets.