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 748321 - gstinfo: gst_debug_unset_threshold_for_name() is an infinite loop for more than one list entry
gstinfo: gst_debug_unset_threshold_for_name() is an infinite loop for more t...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.4.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-22 18:11 UTC by Jason Litzinger
Modified: 2015-04-23 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (2.82 KB, patch)
2015-04-22 18:11 UTC, Jason Litzinger
none Details | Review
proposed fix (850 bytes, patch)
2015-04-22 18:12 UTC, Jason Litzinger
none Details | Review

Description Jason Litzinger 2015-04-22 18:11:51 UTC
Created attachment 302172 [details] [review]
test case

The list iteration code contains an infinite loop triggered if there is more than one item in the list and the first element is removed.

Two patches attache:
0001 - test case
0002 - proposed fix
Comment 1 Jason Litzinger 2015-04-22 18:12:07 UTC
Created attachment 302173 [details] [review]
proposed fix
Comment 2 Jason Litzinger 2015-04-22 18:13:28 UTC
The bug was discovered in 1.4, but exists in master as well.  The patches are against master.
Comment 3 Tim-Philipp Müller 2015-04-23 10:23:58 UTC
Thanks a lot, pushed:

commit 6aee4af0346dfc5054da5ec71f4fddbebd8b9305
Author: Jason Litzinger <jlitzinger@control4.com>
Date:   Wed Apr 22 11:04:06 2015 -0600

    tests: info: add test case to reproduce infinite loop
    
    gst_debug_unset_threshold_for_name() used to go into an
    infinite loop when there was more than one category in
    the list.  This test captures the problem by failing
    via timeout.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748321

commit 1b881ecc26e3eeebf35ee042e170367ae228b26f
Author: Jason Litzinger <jlitzinger@control4.com>
Date:   Wed Apr 22 12:03:33 2015 -0600

    gstinfo: fix infinite loop in gst_debug_unset_threshold_for_name()
    
    Ensure iterator is advanced. The current list iteration code only
    advances the iterator (walk) if a match is found, which results
    in an infinite loop when more than one entry exists in the list.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748321