[Bug 796692] bufferlist: gst_buffer_list_get() can give a writable reference to multiple threads at the same time
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Thu Jun 28 12:39:04 UTC 2018
https://bugzilla.gnome.org/show_bug.cgi?id=796692
Sebastian Dröge (slomo) <slomo at coaxion.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|Normal |High
Status|NEW |NEEDINFO
Severity|normal |critical
--- Comment #11 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
(In reply to Nicolas Dufresne (ndufresne) from comment #10)
> I think the only way things can works is with the following:
> - A buffer is writable if all memory are writable
> - A buffer list is writable if all GstBuffer is writable
This seems the wrong way around. A buffer is writable independent of the
writability of its memories (you can change the PTS even if all memories are
read-only!). And a buffer list is writable even if all buffers are read-only
(you can add new read-only buffers to it).
I'm not sure what your point is :) You mean that buffers should only be
writable if their parent (the buffer list) is writable and the buffer itself
has a refcount of 1?
> Merging/Replacing/Adding/Removing memory is unsafe it's not the case.
> Buffers and BufferLists must have a way to stay immutable, otherwise you
> also break the ability to use tee element.
I don't understand what you mean here. But tee is exactly the case where I ran
into this problem.
The problem is simply that buffers in a buffer list are writable although the
list itself is not writable. And you can get a reference with refcount==1 from
gst_buffer_list_get() in that case. While you are not supposed to modify it in
any way, other immutable operations (buffer mapping!) can modify the buffer as
an optimization and then all falls apart.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list