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 308619 - id3demuxbin tries to free its ghost pad even if it was removed earlier
id3demuxbin tries to free its ghost pad even if it was removed earlier
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.10
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-22 09:00 UTC by Akos Maroy
Modified: 2005-07-02 13:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that fixes the issue (551 bytes, patch)
2005-06-22 09:00 UTC, Akos Maroy
none Details | Review

Description Akos Maroy 2005-06-22 09:00:08 UTC
id3demuxbin tries to free its ghost pad (id3->srcpad), for example when it gets
from PAUSED to READY state, just by look at the internal variable, id3-srcpad.

this is quite unfortunate, as if the pad was removed from the element by
gst_element_remove_pad() from a user of the element, the internal srcpad pointer
will point to an already freed pad, resulting sometimes to a segfault.
Comment 1 Akos Maroy 2005-06-22 09:00:45 UTC
Created attachment 48142 [details] [review]
patch that fixes the issue
Comment 2 Tim-Philipp Müller 2005-06-22 13:30:37 UTC
The pad belongs to the element, I don't think anyone else is allowed to just
remove it. Why would you want to do that anyway?

Cheers
 -Tim
Comment 3 Akos Maroy 2005-06-22 14:45:06 UTC
well, I can remove it with a totally valid, public API call:
gst_element_remove_pad(). an element should not get into an incosistent state
when a valid, public API call is executed on it.


as for why I want to remove it: because I want to remove the typefind element
from underneath id3demuxbin. it has the bad sideeffect that the typefinding is
done again and again as the element is moved from PAUSED/PLAYING state to READY
and the other way around.

but as id3demuxbin:src is a ghostpad the typefind0:src inside it, I have to
remove the ghost pad and create a new one that links to the element right of
typefind0.
Comment 4 Ronald Bultje 2005-06-22 15:01:44 UTC
Then you shouldn't go to READY. If you really have issues with this, just copy
it into your application. I doubt that this is something that we'd want to support.

In this case, gst_element_remove_pad() should only be called by the element
itself, not by the application.
Comment 5 Akos Maroy 2005-06-22 15:07:51 UTC
well, it's not me show's taking it to ready. but if I remove an element from the
pipeline, and put it into another one, gstreamer will for some reason take it
through the READY state.

and what do you mean by 'in this case'? like some API calls work only in
Wednesdays, but not on Saturdays?
Comment 6 Ronald Bultje 2005-07-02 08:38:12 UTC
I think that if you want to remove the typefind, you should just do autoplugging
internally in your app and prefer id3demux over id3demuxbin. As far as I'm
concerned, the pad is owned by id3demuxbin and thus should not be free'ed.
Adding this code would break other things, such as reuse of autopluggers... So
sorry, but I won't accept this patch.

Don't get me wrong, I see the issue that you're having and I acknowledge it. I
just think that the weel-behaviour of other applications is more important than
the small replugging performance increase that some applications would see...
Comment 7 Akos Maroy 2005-07-02 10:43:17 UTC
well, I still don't aggree with your point. while the specific issue at hand is
autoplugging, the real issue is actually that a totally legal, public API call
can make this element incosistent. and I think this is very dangerous.

as for your suggestion, for doing autoplugging 'internally' - you're actually
suggesting to duplicate functionality here - that I should write another
autoplugging framework. but why would I do that?

I'd rather patch the typefind element then, to have a freeze option - so that it
won't re-autoplug when going to READY and than back to PAUSED state...
Comment 8 Tim-Philipp Müller 2005-07-02 13:19:54 UTC
FWIW, I've clarified the API docs for gst_element_remove_pad() a bit now.

 Cheers
  -Tim