Page MenuHomePhabricator

Need a proof of false-positive dead-lock
Open, Showstopper IssuesPublic


Having a Coverity issue about dead-lock in evas_image_scalecache, I wanna you confirm it's an actual problem or just a false-alarm.
For me, it looks an actual problem.

Here deadlock could be happened by "cache_lock" key.

evas_common_rgba_image_scalecache_size_set() -> eina_spinlock_take(cache_lock); -> _cache_prune() -> evas_common_rgba_image_free() -> _evas_common_rgba_image_delete() -> evas_common_rgba_image_scalecache_shutdown() -> evas_common_rgba_image_scalecache_dirty() -> eina_spinlock_take(cache_lock);

This is not only in evas_common_rgba_image_scalecache_size_set() but more scalecache functions do that which means they may have same potential dead lock issues.
Strangely, that code has been there long time, I have never gotten reported any issues about it.

So wish you double-check it, whether logically it doesn't have any problems, something I missed there or not.

Hermet created this task.May 2 2018, 5:39 AM
Hermet triaged this task as Showstopper Issues priority.
Hermet updated the task description. (Show Details)
Hermet updated the task description. (Show Details)
zmike edited projects, added Restricted Project; removed efl.Jun 11 2018, 6:50 AM
segfaultxavi edited projects, added efl: rendering; removed Restricted Project.Jun 11 2018, 7:30 AM
zmike claimed this task.Jun 18 2018, 1:19 PM
zmike added a subscriber: cedric.

This is a deadlock, but the codepath is never triggered because the functions which can cause the deadlock are only called on init, and there are no images in the cache at this point so pruning will never go all the way through to the actual deadlock.

We need to resolve this but it's not required for a release.

@Hermet what do you think about this issue?