cms-colord used the weston_compositor destroy signal to trigger its final colord_module_destroy cleanup, and the wl_output destroy signal to trigger per output cleanup. The problem is that the compositor destroy signal gets emitted before the output destroy signals at compositor shutdown, colord_module_destroy would free all its shared data structures and then later on the output destroy callback would try to access those shared data structures when handling output destruction -> Use after free -> Crash, usually with VT switching dead and thereby an unuseable system requiring a reboot. Solve this by moving the output destruction handling into the colord_cms_output_destroy() cleanup function for colord-cms own hash dictionary of all active outputs. The output destroy callback just removes the corresponding output from the dictionary and triggers proper cleanup if an output is unplugged during runtime. During compositor shutdown, the dictionary as a whole is released before releasing all other shared data structures, thereby triggering cleanup of all remaining outputs. Tested to fix crashes on x11 and drm backends. v2: Formatting: Wrap lines to < 80 characters, as suggested by Derek. Thanks. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>dev
parent
004b4a1dc1
commit
2611ebd316
Loading…
Reference in new issue