[Mono-bugs] [Bug 533257] New: Dictionary <K, V> goes into infinite loop trying to retrieve a value

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 21 09:11:55 EDT 2009


           Summary: Dictionary <K,V> goes into infinite loop trying to
                    retrieve a value
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: amcgovern at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

When debugging some moonlight websites I came across a bug in Dictionary<K, V>
where it would go into an infinite loop in this code:

while (cur != NO_SLOT) {
    // The ordering is important for compatibility with MS and strange
    // Object.Equals () implementations
    if (linkSlots [cur].HashCode == hashCode && hcp.Equals (keySlots [cur],
key)) {
        value = valueSlots [cur];
        return true;
    cur = linkSlots [cur].Next;

linkSlots[cur].Next is returning the same value as 'cur', so we loop forever
checking the same slot. If it's important, the dictionary in question was a
Dictionary<IntPtr, ToggleRef> from Moonlight.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list