[Mono-bugs] [Bug 76739][Maj] New - Compiler error BC0000: Exception: System.NullReferenceException: Object reference not set to an instance of an object

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Nov 17 19:30:34 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by agardner at au1.ibm.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76739

--- shadow/76739	2005-11-17 19:30:34.000000000 -0500
+++ shadow/76739.tmp.3157	2005-11-17 19:30:34.000000000 -0500
@@ -0,0 +1,252 @@
+Bug#: 76739
+Product: Mono: Compilers
+Version: 1.1
+OS: Windows XP (Cygwin)
+OS Details: Windows XP SP1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Basic
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: agardner at au1.ibm.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiler error BC0000: Exception: System.NullReferenceException: Object reference not set to an instance of an object
+
+Description of Problem:
+
+Compiler bombs when trying to compile a VB program.
+
+Steps to reproduce the problem:
+1. mbas /r:System.dll /r:..\..\..\..\Bin\amqmdnet.dll /out:vmqsget.exe
+vmqsget.vb
+2. 
+3. 
+
+Actual Results:
+
+C:\WMQ\Tools\dotnet\samples\vb>mbas /r:System.dll
+/r:..\..\..\..\Bin\amqmdnet.dll /out:vmqsget.exe vmqsget.vb
+MonoBASIC Compiler  1.1.10.0 - (c)2002, 2003, 2004, 2005 Rafael Teixeira
+--------
+THIS IS AN ALPHA SOFTWARE.
+--------
+error BC0000: Exception: System.NullReferenceException: Object reference
+not set to an instance of an object
+in <0x0001f> Mono.MonoBASIC.Expression:NarrowingConversionExists
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression expr, System.Type
+target_type)
+in <0x00149> Mono.MonoBASIC.Invocation:CheckParameterAgainstArgument
+(Mono.MonoBASIC.EmitContext ec, ParameterData pd, Int32 i,
+Mono.MonoBASIC.Argument a, System.Type ptype)
+in <0x003bc> Mono.MonoBASIC.Invocation:IsApplicable
+(Mono.MonoBASIC.EmitContext ec, System.Collections.ArrayList arguments,
+System.Reflection.MethodBase candidate, System.Boolean expanded,
+System.Boolean objectArgsPresent)
+in <0x00219> Mono.MonoBASIC.Invocation:OverloadResolve
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.MethodGroupExpr me,
+System.Collections.ArrayList Arguments, Location loc, System.Boolean
+isLateBindingRequired)
+in <0x0001e> Mono.MonoBASIC.Invocation:OverloadResolve
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.MethodGroupExpr me,
+System.Collections.ArrayList Arguments, Location loc)
+in <0x00156> Mono.MonoBASIC.PropertyGroupExpr:DoResolveLValue
+(Mono.MonoBASIC.EmitContextec, Mono.MonoBASIC.Expression right_side)
+in <0x00945> Mono.MonoBASIC.MemberAccess:DoResolve
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side,
+ResolveFlags flags)
+in <0x00012> Mono.MonoBASIC.MemberAccess:DoResolveLValue
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side)
+in <0x0002b> Mono.MonoBASIC.Expression:ResolveLValue
+(Mono.MonoBASIC.EmitContext ec, Mono.MonoBASIC.Expression right_side)
+in <0x0001d> Mono.MonoBASIC.CompoundAssign:DoResolve
+(Mono.MonoBASIC.EmitContext ec)
+in <0x0016b> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext
+ec, ResolveFlags flags)
+in <0x0000f> Mono.MonoBASIC.Expression:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x0001d> Mono.MonoBASIC.StatementExpression:Resolve
+(Mono.MonoBASIC.EmitContext ec)
+in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x0003a> Mono.MonoBASIC.Do:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x001ad> Mono.MonoBASIC.Block:Resolve (Mono.MonoBASIC.EmitContext ec)
+in <0x000c1> Mono.MonoBASIC.EmitContext:EmitTopBlock (Mono.MonoBASIC.Block
+block, System.String bname, Mono.MonoBASIC.InternalParameters ip, Location loc)
+in <0x00465> Mono.MonoBASIC.MethodData:Emit (Mono.MonoBASIC.TypeContainer
+parent, Mono.MonoBASIC.Block block, System.Object kind)
+in <0x0002e> Mono.MonoBASIC.Method:Emit (Mono.MonoBASIC.TypeContainer parent)
+in <0x00239> Mono.MonoBASIC.TypeContainer:Emit ()
+in <0x00303> Mono.MonoBASIC.RootContext:EmitCode ()
+in <0x0001d> Mono.Languages.Driver:EmitCode ()
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_bool ()
+in <0x000df> Mono.Languages.Driver:Execute (System.String[] args)
+
+Expected Results:
+
+Program compiles successfully
+
+How often does this happen? 
+
+Every time.
+
+Additional Information:
+
+Code being compiled:
+
+'* Library:       WebSphere MQ
+'* Component:     MQ.NET Sample Programs
+'* Part:          VMQSGET.VB
+'*
+'* Description:   Sample Visual Basic program that gets messages from a named
+'*                queue.
+'*
+'*                VMQSGET has 3 parameters:
+'*                - the name of a queue (required)
+'*                - the name of a queue manager (optional)
+'*                - the definition of a channel (optional)
+'*
+'*                If no queue manager name is given, the queue manager
+'*                defaults to the default local queue manager. If a
+'*                channel is defined, it should have the same format
+'*                as the MQSERVER environment variable.
+'*  <N_OCO_COPYRIGHT> 
+'*  Licensed Materials - Property of IBM
+'*  
+'*  63H9336
+'*  (c) Copyright IBM Corp. 1994, 2005 All Rights Reserved.
+'*  
+'*  US Government Users Restricted Rights - Use, duplication or
+'*  disclosure restricted by GSA ADP Schedule Contract with
+'*  IBM Corp.
+'*  <NOC_COPYRIGHT>  
+
+Imports System
+Imports IBM.WMQ
+
+Module vmqsget
+
+    Function Main(ByVal CmdArgs() As String) As Integer
+
+        Dim mqQMgr As MQQueueManager            '* MQQueueManager instance
+        Dim mqQueue As MQQueue                  '* MQQueue instance
+        Dim queueName As String                 '* Name of queue to use
+
+        System.Console.WriteLine("Sample VMQSGET start")
+        If (CmdArgs.Length = 0) Then
+            System.Console.WriteLine("Required parameter missing - queue name")
+            Return (99)
+        Else
+            queueName = CmdArgs.GetValue(0)
+        End If
+
+        '*
+        '* Try to create an MQQueueManager instance 
+        '* 
+        Try
+            If (CmdArgs.Length > 2) Then
+                '* queue name, queue manager name, channel definition all
+provided
+
+                '* Break down the channel definition,
+                '* which is of the form
+"channel-name/transport-type/connection-name".
+                Dim channelDefinition As String = CmdArgs.GetValue(2)
+                Dim channelName As String
+                Dim transportType As String
+                Dim connectionName As String
+                Dim separator As Char() = "/"
+                Dim parts As String()
+
+                parts = channelDefinition.Split(separator)
+                If (parts.Length > 0) Then
+                    channelName = parts(0)
+                End If
+                If (parts.Length > 1) Then
+                    transportType = parts(1)
+                End If
+                If (parts.Length > 2) Then
+                    connectionName = parts(2)
+                End If
+                mqQMgr = New MQQueueManager(CmdArgs.GetValue(1),
+channelName, connectionName)
+            Else
+                If (CmdArgs.Length = 2) Then
+                    '* queue name, queue manager name provided
+                    mqQMgr = New MQQueueManager(CmdArgs.GetValue(1))
+                Else
+                    '* queue name provided - use default queue manager
+                    mqQMgr = New MQQueueManager()
+                End If
+            End If
+        Catch mqe As IBM.WMQ.MQException
+            '* stop if failed
+            System.Console.WriteLine("create of MQQueueManager ended with
+{0}", mqe.Message)
+            Return (mqe.Reason)
+        End Try
+
+
+        '*
+        '* Try to open the queue
+        '*
+        Try
+            mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF
++ MQC.MQOO_FAIL_IF_QUIESCING)       '* open queue for input but not if MQM
+stopping
+        Catch mqe As IBM.WMQ.MQException
+            '* stop if failed
+            System.Console.WriteLine("MQQueueManager::AccessQueue ended
+with {0}", mqe.Message)
+            Return (mqe.Reason)
+        End Try
+
+        '*
+        '* Get messages from the message queue
+        '* Loop until there is a failure
+        '* 
+        Dim isContinue As Boolean = True
+        Do While (isContinue = True)
+            Dim mqMsg As MQMessage                      '* MQMessage instance
+            Dim mqGetMsgOpts As MQGetMessageOptions     '*
+MQGetMessageOptions instance
+
+            mqMsg = New MQMessage()
+            mqGetMsgOpts = New MQGetMessageOptions()
+            mqGetMsgOpts.WaitInterval = 15000  '* 15 second limit for waiting
+            mqGetMsgOpts.Options += MQC.MQGMO_WAIT
+            Try
+                mqQueue.Get(mqMsg, mqGetMsgOpts)
+                If (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) = 0) Then
+                   
+System.Console.WriteLine(mqMsg.ReadString(mqMsg.MessageLength))
+                Else
+                    System.Console.WriteLine("Non-text message")
+                End If
+            Catch mqe As IBM.WMQ.MQException
+                '* report reason, if any
+                If (mqe.Reason = MQC.MQRC_NO_MSG_AVAILABLE) Then
+                    '* special report for normal end
+                    System.Console.WriteLine("no more messages")
+                    isContinue = False
+                Else
+                    '* general report for other reasons
+                    System.Console.WriteLine("MQQueue::Get ended with {0}",
+mqe.Message)
+
+                    '* treat truncated message as a failure for this sample
+                    If (mqe.Reason = MQC.MQRC_TRUNCATED_MSG_FAILED) Then
+                        isContinue = False
+                    End If
+                End If
+            End Try
+        Loop
+
+        System.Console.WriteLine("Sample VMQSGET end")
+        Return (0)
+
+    End Function
+
+End Module


More information about the mono-bugs mailing list