[Mesa-dev] [PATCH] dri3: Prevent multiple freeing of buffers.

Daniel Stone daniel at fooishbar.org
Fri Apr 6 14:51:42 UTC 2018


Hi Sergii,

On 6 April 2018 at 09:12, Sergii Romantsov <sergii.romantsov at gmail.com> wrote:
> Commit 3160cb86aa92 adds optimization with flag 'reallocate'.
> Processing of flag causes buffers freeing while pointer
> is still hold in caller stack and than again used to be freed.

Thanks a lot for writing this. I take it the core of the problem is
that dri3_handle_present_event() can be called whilst we're inside
dri3_get_buffer(), which wasn't the case before.

This was only introduced as of a727c804a2c1, and I'm not sure I fully
follow the rationale for that commit. Thomas, why do we need to
process the events? I guess we could also fake it by turning 'busy'
into a refcount, which would be incremented/decremented as it is today
when posting buffers and getting Idle events, but also when we're
holding a local pointer which we can't have stolen from under us.

Cheers,
Daniel


More information about the mesa-dev mailing list