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 145215 - [PATCH] Fix double-free bug in gst-inspect
[PATCH] Fix double-free bug in gst-inspect
Status: RESOLVED DUPLICATE of bug 144185
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other FreeBSD
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-06-30 19:15 UTC by Joe Marcus Clarke
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix double-free in gst-inspect (283 bytes, patch)
2004-06-30 19:16 UTC, Joe Marcus Clarke
none Details | Review

Description Joe Marcus Clarke 2004-06-30 19:15:27 UTC
Running gst-inspect on certain plug-ins (e.g. cdparanoia) produces a double-free
abort() on FreeBSD.  The problem is the g_slist_foreach() call to g_free() on
each node in the found_signals GSList.  A call to g_slist_free() should be
sufficient to free all the memory in the GSList according to the API and various
other examples.  Attached is a patch that corrects the problem.
Comment 1 Joe Marcus Clarke 2004-06-30 19:16:06 UTC
Created attachment 29124 [details] [review]
Fix double-free in gst-inspect
Comment 2 David Schleef 2004-06-30 19:37:19 UTC
This patch is wrong.  g_slist_free() does not do anything with the ->data
pointer, thus it needs to be freed separately.

I can't reproduce a double free with 'gst-inspect cdparanoia'.
Comment 3 Joe Marcus Clarke 2004-06-30 19:44:13 UTC
Then there needs to be a separate function to check to see if a node has already
been freed.  This is reliably reproduceable on FreeBSD with gstreamer-0.8.3,
gst-plugins-0.8.2, and cdparanoia-3.9.8.  Here is the full backtrace:

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `gst-inspect-0.8'.
Program terminated with signal 6, Aborted.
(gdb) bt full
  • #0 kill
    from /lib/libc.so.5
  • #1 raise
    from /usr/lib/libpthread.so.1
  • #2 abort
    from /lib/libc.so.5
  • #3 ldexp
    from /lib/libc.so.5
  • #4 ldexp
    from /lib/libc.so.5
  • #5 realloc
    from /lib/libc.so.5
  • #6 ldexp
    from /lib/libc.so.5
  • #7 ldexp
    from /lib/libc.so.5
  • #8 free
    from /lib/libc.so.5
  • #9 g_free
    from /usr/local/lib/libglib-2.0.so.400
  • #10 g_slist_foreach
    from /usr/local/lib/libglib-2.0.so.400
  • #11 print_signal_info
    at gst-inspect.c line 802
  • #12 main
    at gst-inspect.c line 1072

Comment 4 David Schleef 2004-06-30 20:10:05 UTC

*** This bug has been marked as a duplicate of 144185 ***