-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random crash in wayfire_foreign_toplevel::init_request_handlers() (race condition with xdg-popups?) #2445
Comments
If your hunch is correct, maybe https://0x0.st/Xy3U.diff will help. But it is hard to say for sure without at least address sanitizer so that we get line numbers. |
So I'm able to reproduce this reliably with this code: https://github.com/dkondor/xdg_popup_crasher Full stacktrace:
|
Nice, thanks for the good reproducer app! Did you check whether my patch helps at all? |
Actually not the previous patch, it had a small mistake, see https://0x0.st/XyY3.diff |
With your patch I seem to get a crash whenever closing a popup the normal way:
|
My bad again, the line I wnat to add should be put 1 line earlier .. https://0x0.st/XyYg.diff |
Yes, the latest one works (it writes the error message about unknown surface which is expected in this case). Thanks! |
Describe the bug
This happened once randomly while I was experimenting in follow up to #2422 -- Wayfire crashed while clicking on an icon with a subdock in Cairo-Dock. My hunch is that this is a race condition with xdg-popups similar to #772 but in this case Wayfire trying to use an "inert" popup (more detailed reasoning below).
To Reproduce
So far I cannot actually reproduce, which is not surprising, since it is likely extremely sensitive to timing, and I've already been using the equivalent setup for ~2-3 years without issues. I do have an idea how to write a reproducible example based on my previous experience with similar race conditions e.g. this and this. Once I have a bit more time, I can experiment with this.
What I did the time it happened:
Expected behavior
Scale is started showing only the views of the selected app. The corresponding subdock might appear as you move the mouse over the icon, and it might be closed once scale starts.
Screenshots or stacktrace
This is from the syslog and unfortunately I don't have debug info enabled:
Wayfire version
git (44e1fa9)
What I think happens
#2
is processed by Wayfire, triggering the crash seen in the stacktrace above as it now refers to an inert popup's surface#2
)Note: likely step
#2
actually happens later, but still before step#6
. Another possibility is that there is actually a bug in CD and it does send aset_rectangle
request on an already-closed popup, and I'll look into this separately, but IMO this should lead to a protocol error and not a crash.The text was updated successfully, but these errors were encountered: