[haiku-bugs] [Haiku] #16459: HaikuDepot; Possible Double-Lock Issue

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sun, 02 Aug 2020 20:10:33 -0000

#16459: HaikuDepot; Possible Double-Lock Issue
-------------------------------------+-----------------------------
 Reporter:  apl-haiku                |       Owner:  apl-haiku
     Type:  bug                      |      Status:  new
 Priority:  normal                   |   Milestone:  Unscheduled
Component:  Applications/HaikuDepot  |     Version:  R1/Development
 Keywords:                           |  Blocked By:
 Blocking:                           |    Platform:  All
-------------------------------------+-----------------------------
 (c.f. Jerome from clang static analysis)


 
https://github.com/haiku/haiku/blob/master/src/apps/haikudepot/server/ProcessCoordinatorFactory.cpp#L106
 acquires a lock which is already held by
 
https://github.com/haiku/haiku/blob/master/src/apps/haikudepot/server/ProcessCoordinatorFactory.cpp#L61


C++
objects/haiku/x86_64/release/apps/haikudepot/ProcessCoordinatorFactory.o
../src/apps/haikudepot/server/ProcessCoordinatorFactory.cpp:106:24:
warning: acquiring mutex 'model->Lock()' that is already held
[-Wthread-safety-analysis]
                        AutoLocker<BLocker> locker(model->Lock());
                                            ^
../src/apps/haikudepot/server/ProcessCoordinatorFactory.cpp:61:12:
note: mutex acquired here
        BAutolock locker(model->Lock());

It might though be a false-positive.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16459>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: