Don't crash if a client (legally) uses deleted global contrast manager
ClosedPublic

Authored by davidedmundson on Sep 20 2017, 1:17 PM.

Details

Summary

There is a race condition in the following situation:

  • Server creates a global
  • Client binds to that global (making a new resource for that

global)

Simultaneously:
- The client uses this resource
- The server deletes the global

This was fixed for Blur, but as mention in that commit can also happen here.
Code is effectively a copy and paste from eaac3948f1499b638799f05b6b229ee30b02eb9a

Test Plan

Unit test. Booted normal session

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Sep 20 2017, 1:17 PM
Restricted Application added projects: Plasma on Wayland, Frameworks. · View Herald TranscriptSep 20 2017, 1:17 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
graesslin accepted this revision.Sep 20 2017, 3:20 PM
This revision is now accepted and ready to land.Sep 20 2017, 3:20 PM
This revision was automatically updated to reflect the committed changes.
davidedmundson added a comment.EditedOct 10 2017, 12:30 PM

Found a better approach that we can use globally (pun not intended)

If we track resources, we can re-call wl_set_implementation with a nullpointer in the callback for in the global destructor.