[Bug 761916] gstinfo: Make GST_DEBUG_PAD_NAME "MT crash safe" (for gcc)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Feb 12 14:06:12 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=761916

--- Comment #3 from Stian Selnes (stianse) <stian.selnes at gmail.com> ---
Created attachment 320978
  --> https://bugzilla.gnome.org/attachment.cgi?id=320978&action=edit
alternative fix using inline function

I'm not sure how to implement this safely with a function. As mentioned in
previous comment the function cannot return a string that goes out of scope. If
it returns NULL instead when there is no parent and we use GST_PTR_NULL or
similar to try to make it safe, the function needs to be called twice (when
assuming no compiler optimizations): Once for checking if name is not NULL and
then again for getting the name which in the meantime could have been set to
NULL. So in this case the GST_DEBUG_PAD_NAME can potentially return NULL which
we want to avoid.

That said, this patch at least does not use GCC extensions and is still an
improvement over the existing macro that segfaults in the macro itself.

-- 
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