[Mono-bugs] [Bug 344217] New: VB. NET Late binding fails with ByRef output 2-dimensional array parameters.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 27 02:14:24 EST 2007


           Summary: VB.NET Late binding fails with ByRef output 2-
                    dimensional array parameters.
           Product: Mono: Runtime
           Version: SVN
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: juanj.g_soria at grupobbva.com
         QAContact: mono-bugs at ximian.com
          Found By: ---

We are migrating some code from VB 6.0 to VB.NET under VS2005 to mono.

We found a problem with late binding in which the invocation of a method with a
ByRef output parameter whose type is a bidimensional array will fail.

This is a test case that works in MS .NET implementation:


Option Strict Off
Option Explicit On

Module TestModule
    Public Class StrangeClass
        Sub TheFunc(ByRef output(,) As Double)
            output(0, 0) = 1.0
        End Sub
    End Class

    Sub Main()
        Dim o As Object
        o = New StrangeClass
        Dim data(1, 1) As Double

    End Sub
End Module


This, however, when run on SVN mono under Windows produces the following


u514252 at W21682DD
$ mono --version
Mono JIT compiler version 1.2.6 (/trunk/ r90275)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

u514252 at W21682DD
$ mono LateBindingTest1.exe 

Unhandled Exception: System.ArgumentException: Array was not a one-dimensional
  at System.Array.GetValue (Int32 index) [0x00000] 
  at Microsoft.VisualBasic.CompilerServices.LateBinder.ReorderArgumentArray
(System.Object[]& args, System.Object state) [0x00000] 
  at System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object target, System.Object[] args,
System.Reflection.ParameterModifier[] modifiers,
System.Globalization.CultureInfo culture, System.String[] namedParameters)
  at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet (System.Object
o, System.Type objType, System.String name, System.Object[] args,
System.String[] paramnames, System.Boolean[] CopyBack) [0x00000] 
  at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall
(System.Object Instance, System.Type Type, System.String MemberName,
System.Object[] Arguments, System.String[] ArgumentNames, System.Type[]
TypeArguments, System.Boolean[] CopyBack, Boolean IgnoreReturn) [0x00000] 
  at LateBindingTest1.TestModule.Main () [0x00000] 

u514252 at W21682DD


The limited amount of debugging that I've been able to do seems to suggest that
Microsoft.VisualBasic.CompilerServices.LateBinder.ReorderArgumentArray() is not
actually prepared to handle this case and will try to do something with the
parameter as a 1-dimensional array, triggering the issue at

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