[Mono-bugs] [Bug 573322] New: Array.SetValue is very unreliable for arrays of Nullable types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jan 23 18:31:26 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=573322

http://bugzilla.novell.com/show_bug.cgi?id=573322#c0


           Summary: Array.SetValue is very unreliable for arrays of
                    Nullable types
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tagdev at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=338466)
 --> (http://bugzilla.novell.com/attachment.cgi?id=338466)
Patch to apply to Mono's trunk, which adds a test for this bug.

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3)
Gecko/20090824 Firefox/3.5.3 GTB6 (.NET CLR 3.5.30729)

When using the System.Array.SetValue(Object value, int index) method on arrays
containing Nullable data-types, the specified array-element would only
sometimes be set to the required value; other times the value resets to null.

For example, see the following output from a session in the C# interactive
shell:
csharp> var i = new int?[3];
csharp> i;
{ null, null, null }
csharp> i.SetValue(8, 2);
csharp> i;                
{ null, null, null }
csharp> i.SetValue(8, 2); 
csharp> i;                
{ null, null, null }
csharp> i.SetValue(8, 2); 
csharp> i;                
{ null, null, 8 }
csharp> i.SetValue(5, 0); 
csharp> i;                
{ 5, null, 8 }
csharp> i.SetValue(5, 0); 
csharp> i;                
{ null, null, 8 }


Reproducible: Sometimes

Steps to Reproduce:
1. Apply the attached test to the trunk, which thoroughly tests the reliability
of the Array.SetValue method, and run it with NUnit to get an indication of the
failure rate; 
2. or, Repeat the session in the C# interactive shell as shown in the Details
section.

Actual Results:  
Only sometimes the array element's value is set to the correct value.

Expected Results:  
Array.SetValue must always set the element values to the specified value.

It seems as if the problem might be with the Array class's internal call named
SetValueImpl (aka, ves_icall_System_Array_SetValueImpl). 

The attached test only takes a few milliseconds to execute and should perhaps
be included in the standard set of test cases once the bug is fixed.

-- 
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