[Mono-bugs] [Bug 471252] New: Array.SetValue(array, int[]) raises exception IndexOutOfRangeException on Mono only (works in .NET)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 30 22:22:42 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=471252


           Summary: Array.SetValue(array, int[]) raises exception
                    IndexOutOfRangeException on Mono only (works in .NET)
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: x86
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: joe at mistachkin.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20)
Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729)


The Eagle unit test object-2.1 causes Mono to through an exception when
SetValue is used on an array.  This exception is not thrown by .NET with the
identical unit tests.  I believe the bug may be triggered by using an index
array that contains negative index values.

---- object-2.1 start

==== object-2.1 object usage with arguments, ref, out, nested,
multi-dimensional array, etc FAILED
==== Contents of test case:

  catch {unset t1}; # input/output param
  set t1() "this is not an integer; however, it does not matter"
  set t1(0) 0x1234

  catch {unset t2}; # input/output param
  set t2() "this is not an integer; however, it does not matter"
  set t2(-1,-2) 0x999
  set t2(0,0) 0x01
  set t2(0,1) 0x02
  set t2(1,0) 0x04
  set t2(1,1) 0x08
  set t2(2,1) 0x10

  catch {unset t3}; # input/output param
  set t3() "this element will not be changed"
  set t3(0) "this element will be changed"

  catch {unset t4}; # output only param
  catch {unset t5}; # output only param
  catch {unset t6}; # output only param

  list [set o1 [object create Eagle._Tests.Default]] [set o2 [object invoke 
$o1 TestComplexMethod 127 909 yes [expr pi()] t1 t2 t3 t4 t5 t6]]  [array get
t1] [array get t2] [array get t3] $t4 [array get t5]  [array get t6] [unset o2]
[object dispose $o1] [unset o1] [llength  [info objects]] [set o3 [object
create System.Int32]] [object invoke  -types {-Method -Property} -flags
{+NonPublic -Public -Static  -InvokeMethod} $o3 m_value 9999] [set o4 [object
invoke -create  System.Int32 Parse 10101]] [set o5 [object create -nocase
system.int32]]  [object invoke -types {-Method -Property} -flags {+NonPublic
-Public  -Static -InvokeMethod} $o5 m_value 9999] [object invoke System.String 
Format "{0} {1} {2}" $o3 $o4 $o5] [object dispose $o5] [object dispose  $o4]
[object dispose $o3] [llength [info objects]]

---- Test generated error; Return code was: Error
---- Return code should have been one of: Ok Return
---- errorInfo: caught exception while executing command:
System.IndexOutOfRangeException: Array index is out of range.
  at (wrapper managed-to-native) System.Array:SetValue (object,int[])
  at Eagle._Components.Private.MarshalOps.FixupArray
(Eagle._Components.Public.Interpreter interpreter, System.Reflection.Binder
binder, System.Globalization.CultureInfo cultureInfo, System.Type type,
System.Type elementType, Boolean input, Boolean output, System.Object& arg,
Eagle._Components.Public.Result& error) [0x00000] 
  at Eagle._Components.Private.MarshalOps.FixupArgument
(Eagle._Components.Public.Interpreter interpreter, System.Reflection.Binder
binder, System.Globalization.CultureInfo cultureInfo, System.Type type, Boolean
input, Boolean output, System.Object& arg, Eagle._Components.Public.Result&
error) [0x00000] 
  at Eagle._Components.Private.MarshalOps.FindMemberAndFixupArguments
(Eagle._Components.Public.Interpreter interpreter, System.Reflection.Binder
binder, System.Globalization.CultureInfo cultureInfo, System.Type type,
System.String objectName, System.String memberName, MemberTypes memberTypes,
BindingFlags bindingFlags, System.Reflection.MethodBase[] members,
Eagle._Containers.Public.TypeList parameterTypes, System.Object[]& args,
System.Int32& methodIndex, Eagle._Containers.Private.ArgumentInfoList&
argumentInfoList, Eagle._Components.Public.Result& error) [0x00000] 
  at Eagle._Commands.Object.Execute (Eagle._Components.Public.Interpreter
interpreter, IClientData clientData, Eagle._Containers.Public.ArgumentList
arguments, Eagle._Components.Public.Result& result) [0x00000] 
  at Eagle._Wrappers.Command.Execute (Eagle._Components.Public.Interpreter
interpreter, IClientData clientData, Eagle._Containers.Public.ArgumentList
arguments, Eagle._Components.Public.Result& result) [0x00000] 
  at Eagle._Components.Public.Engine.ExecuteCommand (ICommand command,
Eagle._Components.Public.Interpreter interpreter, IClientData clientData,
Eagle._Containers.Public.ArgumentList arguments, EngineFlags engineFlags,
SubstitutionFlags substitutionFlags, Eagle._Components.Public.Result& result)
[0x00000] 
    while executing
"object invoke  $o1 TestComplexMethod 127 909 yes [expr pi()] t1 t2 t3 t4 t5
t6"
    invoked from within
"set o2 [object invoke  $o1 TestComplexMethod 127 909 yes [expr pi()] t1 t2 t3
t4 t5 t6]"
    invoked from within
"list [set o1 [object create Eagle._Tests.Default]] [set o2 [object invoke  $o1
TestComplexMethod 127 909 yes [expr pi()] t1 t2 t3 t4 t5 t6]]  [array g..."
---- errorCode: NONE
==== object-2.1 FAILED


Reproducible: Always

Steps to Reproduce:
1. Download the "Mono-on-Unix" binaries distribution from: http://eagle.to/
2. Start the EagleShell.exe under the Mono of your choice (fails in 2.0 and
2.2)
3. Type "set argv [list -constraints monoBug]" and hit enter.
4. Type "#test object2*" and hit enter to see the failure (complete with stack
trace).

Actual Results:  
IndexOutOfRangeException

Expected Results:  
the unit test should pass

-- 
Configure bugmail: https://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