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 750154 - childproxy: don't crash when interface methods are not implemented
childproxy: don't crash when interface methods are not implemented
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.12.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-30 16:49 UTC by Mathieu Duponchelle
Modified: 2018-01-26 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstchildproxy: Fix segmentation fault. (1.24 KB, patch)
2015-05-30 16:49 UTC, Mathieu Duponchelle
needs-work Details | Review
childproxy: gracefully handle methods being NULL (2.19 KB, patch)
2018-01-20 15:34 UTC, Tim-Philipp Müller
committed Details | Review

Description Mathieu Duponchelle 2015-05-30 16:49:51 UTC
By checking if virtual methods are implemented before calling
them.
Comment 1 Mathieu Duponchelle 2015-05-30 16:49:55 UTC
Created attachment 304314 [details] [review]
gstchildproxy: Fix segmentation fault.
Comment 2 Tim-Philipp Müller 2016-06-02 10:02:27 UTC
Comment on attachment 304314 [details] [review]
gstchildproxy: Fix segmentation fault.

Let's do the GET_INTERFACE() only once :)
Comment 3 Tim-Philipp Müller 2018-01-20 15:34:01 UTC
Created attachment 367147 [details] [review]
childproxy: gracefully handle methods being NULL

Alternative patch.

Question is: is it allowed for these methods to be NULL?

If yes, we should use my patch.

If not we should probably assert, or use my patch with an extra warning.

It's not a programming mistake by the application developer / caller, so I'm not sure if g_return_if_fail() is quite right here.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2018-01-21 17:34:05 UTC
Review of attachment 367147 [details] [review]:

Looks good to me. Not sure if we can check that all methods are implemented during instantiation time instead, but this is probably not that performance critical anyway.
Comment 5 Tim-Philipp Müller 2018-01-21 18:47:31 UTC
commit db1d99db76379e8bceb26fcee951822fd5e1819b (HEAD -> master)
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sat Jan 20 15:30:53 2018 +0000

    childproxy: gracefully handle methods being NULL
    
    Do this for all method invoke functions for consistency.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750154