[Bug 759535] New: gst_clock_id_unschedule isnt thread safe
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Wed Dec 16 02:25:38 PST 2015
https://bugzilla.gnome.org/show_bug.cgi?id=759535
Bug ID: 759535
Summary: gst_clock_id_unschedule isnt thread safe
Classification: Platform
Product: GStreamer
Version: 1.4.5
OS: Windows
Status: NEW
Severity: major
Priority: Normal
Component: gstreamer (core)
Assignee: gstreamer-bugs at lists.freedesktop.org
Reporter: james at stev.org
QA Contact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
Created attachment 317489
--> https://bugzilla.gnome.org/attachment.cgi?id=317489&action=edit
Test case for gst_clock_id_unschedule
When using gst_clock_new_periodic_id and gst_clock_id_unschedule the
documentation claims they are thread safe but it seems to be impossible to
disable a timer without the risk of a race which can cause the application to
core. I trace this down to the fact that the timer can be active after
gst_clock_id_unschedule has returned. Which would make the api non thread safe
to use.
I have attached a test case for this which will cause the valgrind invalid
memory reads below
==11520== Invalid read of size 8
==11520== at 0x57016DF: __GI_mempcpy (memcpy.S:107)
==11520== by 0x56EE53C: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1312)
==11520== by 0x56C0AB4: vfprintf (vfprintf.c:1642)
==11520== by 0x56C9588: printf (printf.c:33)
==11520== by 0x400B31: callback (in /home/james/tmp/a.out)
==11520== by 0x4EC5421: gst_system_clock_async_thread (in
/usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.403.0)
==11520== by 0x51B8924: g_thread_proxy (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==11520== by 0x545F0A4: start_thread (pthread_create.c:309)
==11520== by 0x576ECFC: clone (clone.S:111)
==11520== Address 0x6e574c3 is 3 bytes inside a block of size 12 free'd
==11520== at 0x4C2BE10: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11520== by 0x400BF8: main (in /home/james/tmp/a.out)
==11520==
the test program can be compiled with gcc -Wall gstclock.c `pkg-config
--cflags --libs gstreamer-1.0` on ubuntu
--
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