[haiku-bugs] Re: [Haiku] #14983: [app_server] crashes after double clicking Audio Mixer in Cortex

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sat, 21 Mar 2020 13:16:58 -0000

#14983: [app_server] crashes after double clicking Audio Mixer in Cortex
----------------------------------+----------------------------
   Reporter:  diver               |      Owner:  axeld
       Type:  bug                 |     Status:  new
   Priority:  critical            |  Milestone:  R1/beta2
  Component:  Servers/app_server  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:  15597
Has a Patch:  0                   |   Platform:  All
----------------------------------+----------------------------
Comment (by pulkomandy):

 I reproduced the crash 2 or 3 times and I see that it's always in
 HWInterface::_AdoptDragBitmap(ServerBitmap const*, BPoint const&).

 I see that BListView "resets" fTrack->drag_start on double click. I guess
 the idea is that this should cancel the drag operation, but I don't see
 how it would achieve that. Quite the opposite, it makes sure the distance
 computation in the dragging thread will overflow and give an unexpected
 result...

 Also, this code will spawn a new mouse tracking thread on every mouse
 click, which... well, I think is not the way to go about this. The threads
 are snoozing for a while, and if you time the clicks appropriately you can
 accumulate as many of them as you want. And then they will all want to
 initiate a drag (well, at least they do lock the looper before doing
 that).

 I think we should rework the code in BListView to not use MouseDownThread,
 and just run in the normal message loop instead. This will make this a lot
 simpler to trace and debug, if it doesn't solve it.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/14983#comment:10>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: