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 610367 - [memindex] might busy loop upon EXACT lookup
[memindex] might busy loop upon EXACT lookup
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-18 15:01 UTC by Mark Nauwelaerts
Modified: 2010-02-18 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix loop by avoiding loop altogether (1.10 KB, patch)
2010-02-18 15:01 UTC, Mark Nauwelaerts
none Details | Review
Avoid loop when needed (1.11 KB, patch)
2010-02-18 15:13 UTC, Mark Nauwelaerts
none Details | Review
Avoid loop when needed (1.09 KB, patch)
2010-02-18 16:25 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2010-02-18 15:01:43 UTC
Created attachment 154140 [details] [review]
Fix loop by avoiding loop altogether

Subject says most, if a sufficiently adequate entry is not found when doing a LOOKUP_EXACT, it might end up in a never ending while ().

Attached patch should fix according to semantics (afaics).
I am also not entirely clear on how doing g_list_next or g_list_previous on an unsorted list [*] is likely to end up with desired/optimal result ?

[*] though in typical cases it will probably end up sort-of sorted descending, in which case list walk would match that
Comment 1 Mark Nauwelaerts 2010-02-18 15:13:11 UTC
Created attachment 154142 [details] [review]
Avoid loop when needed

Erm, slight confusion, this one should fix with expected semantics.
Comment 2 Tim-Philipp Müller 2010-02-18 15:58:32 UTC
No idea about the next/prev, but it'd be good to fix the busy loop, so please commit.

(Any reason to check the flags twice though instead of moving the method check inside the if flags block?)
Comment 3 Mark Nauwelaerts 2010-02-18 16:05:56 UTC
No particular reason for checking twice.  So you would prefer a nested if?
Comment 4 Mark Nauwelaerts 2010-02-18 16:25:35 UTC
Created attachment 154149 [details] [review]
Avoid loop when needed

... slick style this time.
Comment 5 Mark Nauwelaerts 2010-02-18 16:26:42 UTC
commit 2aea9ad231a6b3e9e8846d7e4fde098c5e15af70
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Thu Feb 18 17:15:35 2010 +0100

    memindex: avoid busy loop when doing EXACT lookup

    Fixes #610367.