After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648199 - pad: potential deadlock / crash when freeing cache
pad: potential deadlock / crash when freeing cache
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal critical
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-19 12:10 UTC by Håvard Graff (hgr)
Modified: 2011-04-19 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (775 bytes, patch)
2011-04-19 12:10 UTC, Håvard Graff (hgr)
none Details | Review
patch with fixed author (786 bytes, patch)
2011-04-19 13:55 UTC, Håvard Graff (hgr)
committed Details | Review

Description Håvard Graff (hgr) 2011-04-19 12:10:05 UTC
Created attachment 186272 [details] [review]
patch

We have had this callstack lately:
 	libglib-2.0-0.dll!g_logv(const char * log_domain=0x74fd853c, GLogLevelFlags log_level=G_LOG_LEVEL_ERROR, const char * format=0x74fd8ec8, char * args1=0x0332e914)  Line 554 + 0x8 bytes	C
 	libglib-2.0-0.dll!g_log(const char * log_domain=0x74fd853c, GLogLevelFlags log_level=G_LOG_LEVEL_ERROR, const char * format=0x74fd8ec8, ...)  Line 599 + 0x15 bytes	C
 	libgthread-2.0-0.dll!g_mutex_free_errorcheck_impl(_GMutex * mutex=0x03747460, const unsigned long magic=0xf8e18ad7, char * const location=0x6ddeabb8)  Line 179 + 0x1b bytes	C
 	libglib-2.0-0.dll!g_static_mutex_free(_GMutex * * mutex=0x02924450)  Line 1388 + 0x21 bytes	C
 	libglib-2.0-0.dll!g_static_rec_mutex_free(_GStaticRecMutex * mutex=0x02924450)  Line 1627 + 0x9 bytes	C
 	libgstreamer-0.10-0.dll!gst_pad_finalize(_GObject * object=0x02925370)  Line 461 + 0xc bytes	C
 	libgobject-2.0-0.dll!g_object_unref(void * _object=0x02925370)  Line 2726 + 0x10 bytes	C
 	libgstreamer-0.10-0.dll!gst_object_unref(void * object=0x02925370)  Line 338 + 0x9 bytes	C
 	libgstreamer-0.10-0.dll!pad_free_cache(_GstPadPushCache * cache=0x028e7220)  Line 4598 + 0xb bytes	C
>	libgstreamer-0.10-0.dll!gst_pad_push(_GstPad * pad=0x029215b8, _GstBuffer * buffer=0x028965d8)  Line 4746 + 0x9 bytes	C
 	libgstreamer-0.10-0.dll!gst_proxy_pad_do_chain(_GstPad * pad=0x02922538, _GstBuffer * buffer=0x028965d8)  Line 171 + 0xd bytes	C
 	libgstreamer-0.10-0.dll!gst_pad_push(_GstPad * pad=0x02895360, _GstBuffer * buffer=0x028965d8)  Line 4709 + 0x15 bytes	C
 	libgstrtpmanager.dll!gst_rtp_session_send_rtcp(_RTPSession * sess=0x028ea530, _RTPSource * src=0x03688650, _GstBuffer * buffer=0x028965d8, int eos=0x00000000, void * user_data=0x028e91c8)  Line 1065 + 0xd bytes	C
 	libgstrtpmanager.dll!rtp_session_on_timeout(_RTPSession * sess=0x028ea530, unsigned __int64 current_time=0x00000d5b4710c822, unsigned __int64 ntpnstime=0x30bca2f8816a4a00, unsigned __int64 running_time=0x00000d5b4710d72c)  Line 3378 + 0x58 bytes	C
 	libgstrtpmanager.dll!rtcp_thread(_GstRtpSession * rtpsession=0x028e91c8)  Line 853 + 0x21 bytes	C
 	libglib-2.0-0.dll!g_thread_create_proxy(void * data=0x00a3d050)  Line 1955 + 0x10 bytes	C
 	libgthread-2.0-0.dll!g_thread_proxy(void * data=0x028cb320)  Line 509 + 0x10 bytes	C

As you can see, the pad_free_cache is trying to free a mutex that is being held. The solution is simply to unlock that lock (stream-lock) before freeing the cache.
Comment 1 Håvard Graff (hgr) 2011-04-19 13:55:40 UTC
Created attachment 186288 [details] [review]
patch with fixed author
Comment 2 Tim-Philipp Müller 2011-04-19 14:22:40 UTC
Pushed, thanks!

commit 547d4517720ceb6068cdbd3921af426741c1fb83
Author: Havard Graff <havard.graff@tandberg.com>
Date:   Tue Apr 19 14:05:23 2011 +0200

    pad: unlock before freeing the cache to avoid deadlock
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648199