GNOME Bugzilla – Bug 755269
incorrect g_object_unref() in gdk-pixbuf-animation
Last modified: 2015-09-19 19:37:07 UTC
Recently, gdk-pixbuf-animation is moved to GTask: https://git.gnome.org/browse/gdk-pixbuf/commit/?id=3bdf3b74b3c0e535392b540458095f7a95ba11e7 However, with the new gdk-pixbuf (2.31.7), corebird crashes with use after free: Program received signal SIGBUS, Bus error.
+ Trace 235473
Thread 34724599808 (LWP 101780)
After closer inspection, task->task_func points to animation_new_from_stream_thread() in gdk-pixbuf-animation. When task_func is being called, task's ref count is 1, and animation_new_from_stream_thread() called g_object_unref(), which caused the task to be finalized. However, after calling task_func, the gtask thread pool function calls g_task_thread_complete() on the task, which was finalized, and crashes. At the end of g_task_thread_pool_thread(), g_object_unref() is called on task, so it's not needed to call g_object_unref() in animation_new_from_stream_thread().