Ticket #757 (closed bug: fixed)

Opened 4 years ago

Last modified 17 months ago

[app_server] deadlock on workspace switching

Reported by: diver Owned by: axeld
Priority: critical Milestone: R1
Component: Servers/app_server Version:
Keywords: Cc:
Blocked By: Platform: All
Blocking:

Description (last modified by axeld) (diff)

This is hard to reproduce i fear, but i'll try to explain. This is kinda stress test and takes about 3-5 min. After Haiku bootup type in terminal - screensaver. You need to switch workspaces (alt+f1,alt+f2) like crazy and in the same time you need to switch betwen terminal and screensaver from in the team menu of the deskbar. You couls see various things, like some menus opening in the upper left corner, white spaces, etc. After several minutes app_server will just freeze.

Attachments

app_server_crash_9.PNG Download (23.9 KB) - added by diver 4 years ago.
back trace for comment #1

Change History

  Changed 4 years ago by diver

Checked again and this time app_server crashed in WindowLayer::Frontmost() as in #195.

  Changed 4 years ago by diver

Ok, it seems i found a way to deadlock it faster, press Be Menu-Preferences, select all prefs and start them at once. After they are loaded repeat steps in my first comment after this line: "After Haiku bootup type in terminal - screensaver." app_server should lock up after 3-6 seconds. Hope this would help...

  Changed 4 years ago by diver

It seems that the more you have opened apps the faster you could dead lock app_server, i could reproduce this dead lock very easy now, it takes me a second or two (no more 3-5 min) now to bring down app_server ;-)

Changed 4 years ago by diver

back trace for comment #1

  Changed 4 years ago by axeld

  • platform set to All
  • component changed from General to User Interface/Application Server
  • description modified (diff)

follow-up: ↓ 6   Changed 4 years ago by axeld

I'm afraid I don't understand your description. What should I do with ScreenSaver and Terminal, and how?

in reply to: ↑ 5   Changed 4 years ago by diver

Replying to axeld:

I'm afraid I don't understand your description. What should I do with ScreenSaver and Terminal, and how?

Ok, this is just a copy & paste bug from another ticket :-) You don't need to do anything with ScreenSaver and Terminal now, what you need is: Boot haiku, BeMenu->Preferences->click. Select all items in this folder and press enter to load them at once. After they all loaded you need to start clicking fast on team menu of the Deskbar of just select one of them (e.g. the last one, in my case it's FileTypes) and in the same time you need to start switching workspaces via alt+f1/alt+f2 as fast as you click on FileTypes, after 2-3 sec you will deadlock app_server. Hope this would help...

  Changed 4 years ago by axeld

That helped, thanks! Does this still happen after r18646? Even though, I didn't track it back to have anything to do with DesktopSettings (this only happened when I had "Workspaces" open), I can't reproduce it anymore. (I only see drawing bugs for which I'll open a new bug report)

  Changed 4 years ago by diver

I managed to reproduce this deadlock only once again, but it might be caused of low memory situation.

  Changed 4 years ago by axeld

A locking deadlock can't really be caused by low memory (unless low memory causes a different code path that exposes a locking bug), so I leave this bug open for now. Thanks for the update!

  Changed 3 years ago by diver

This deadlock still with us at r21691.

  Changed 2 years ago by axeld

  • milestone changed from R1 to R1/alpha

  Changed 2 years ago by stippi

  • status changed from new to closed
  • resolution set to fixed

There was indeed a deadlock in the EventFilter for keyboard events, I changed that recently to process the workspace switch event in the Desktop thread, so it should be fixed for good. The event filter tried to lock the desktop to switch workspaces, but the desktop could already be locked itself and trying to grab the event dispatcher lock... deadlock.

  Changed 2 years ago by diver

  • status changed from closed to reopened
  • resolution fixed deleted

I could still deadlock it with r22510 under vmware, reopening.

  Changed 2 years ago by diver

Oh and strange thing is that Time & Date preflet still running, but i can't move any window and interface is not responding at all, but clock arrows are still moving.

follow-up: ↓ 16   Changed 2 years ago by axeld

Can you still reproduce this with r22614? At least I've fixed a few deadlock situations there. The Time&Date thing is really strange, though - that sounds like a different kind of deadlock.

in reply to: ↑ 15   Changed 2 years ago by jackburton

Replying to axeld:

Can you still reproduce this with r22614? At least I've fixed a few deadlock situations there. The Time&Date thing is really strange, though - that sounds like a different kind of deadlock.

I could reproduce that thing too, but by creating a new project with BeIDE. The GUI was all frozen, except the mouse pointer (which, AFAIK, is moved from another thread).

  Changed 2 years ago by stippi

diver, can you still reproduce the deadlock when switching workspaces? I think I have fixed a deadlock when using the keyboard shortcuts to switch workspaces, while Axel later fixed some more that affected workspace switching with the mouse, if I understand correctly.

  Changed 2 years ago by stippi

  • status changed from reopened to closed
  • resolution set to fixed

While investigating #634, I have switched workspaces like mad all afternoon. I have not once experienced a lockup (running in VMWare). If there is another way to produce this, than by opening all apps at once and quickly switching workspaces at the same time either by keyboard shortcut or via the Workspaces applet (mouse), then please reopen...

  Changed 2 years ago by diver

  • status changed from closed to reopened
  • resolution fixed deleted

I tried the same with r22730 and managed to deadlock it twice. Strange but cursor in Terminal still blinks and i see ProcessController activity in Deskbar, but in the same time i can't move any window and system is not responding to mouse/keyboard events. I would like to reopen this bug as there are still some problems remain.

  Changed 2 years ago by stippi

Just to be sure, by "I tried the same" you mean the way to reproduce this I outlined above?

  Changed 2 years ago by diver

Yes, i mean that i could reproduce it the way i describe it above.

  Changed 2 years ago by diver

Still here in r23879

  Changed 2 years ago by emitrax

Is this bug still with us? I gave it a shot to reproduce it quickly but I had not luck. Do you still reproduce it in the same way?

  Changed 22 months ago by diver

I managed to deadlock it in the same way in r25588.

  Changed 20 months ago by scottmc

Can anyone other than diver reproduce this? I wasn't able to... If this stays open I think it should be moved from R1/alpha to R1, that is unless someone else is able to reproduce it.

  Changed 20 months ago by axeld

  • milestone changed from R1/alpha1 to R1

I completely agree. While deadlocking the app_server is truly unfortunate, if one has to try that hard to do it (I didn't manage to do so), it shouldn't stop the alpha.

  Changed 20 months ago by axeld

  • priority changed from blocker to critical

  Changed 17 months ago by stippi

  • status changed from reopened to closed
  • resolution set to fixed

Most likely fixed by r28217. We fixed exactly such a problem. The deadlock happened when popping up a new window, which also activates it and thus triggers a workspace change when you managed to switch the workspace before the window finally showed. Please reopen if you can still reproduce (we only managed to still reproduce it with StressTest).

Note: See TracTickets for help on using tickets.