Please file a bug report with a test case and make sure you use line endings.<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 7:59 PM, tadaP <span dir="ltr"><<a href="mailto:prasadhappy@yahoo.com" target="_blank">prasadhappy@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am consistently having a System.NullReferenceException on making a WCF call.
The application is a multi-threaded app and each thread makes a WCF call at a
certain interval. I see the app throwing exception everytime I start the app
and at the same thread.

I am using Mono 3.0.5.


The stack trace looks as below

[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object
reference not set to an instance of an object
  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex,
System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00104]
in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Array.cs:975 
  at System.Collections.ArrayList.CopyTo (Int32 index, System.Array array,
Int32 arrayIndex, Int32 count) [0x0002d] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections/ArrayList.cs:3064 
  at System.Collections.ArrayList.CopyTo (System.Array array, Int32 arrayIndex)
[0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections/ArrayList.cs:3046 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj,
System.Type attributeType, Boolean inherit) [0x0028f] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/MonoCustomAttrs.cs:252 
  at System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean
inherit) [0x00017] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/MonoType.cs:582 
  at
System.Runtime.Serialization.KnownTypeCollection.GetAttribute[CollectionDataContractAttribute]
(ICustomAttributeProvider ap) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs:779 
  at
System.Runtime.Serialization.KnownTypeCollection.RegisterCollectionContract
(System.Type type) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs:785 
  at System.Runtime.Serialization.KnownTypeCollection.DoTryRegister
(System.Type type) [0x00038] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs:742 
  at System.Runtime.Serialization.KnownTypeCollection.TryRegister (System.Type
type) [0x0000c] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs:723 
  at System.Runtime.Serialization.KnownTypeCollection.InsertItem (Int32 index,
System.Type type) [0x00019] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs:466 
  at System.Collections.ObjectModel.Collection`1[System.Type].Add (System.Type
item) [0x0000c] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:74 
  at System.Runtime.Serialization.DataContractSerializer.RegisterTypeAsKnown
(System.Type type) [0x00026] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:238 
  at System.Runtime.Serialization.DataContractSerializer.PopulateTypes
(IEnumerable`1 knownTypes) [0x00058] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:226 
  at System.Runtime.Serialization.DataContractSerializer..ctor (System.Type
type, System.String rootName, System.String rootNamespace, IEnumerable`1
knownTypes) [0x00051] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs:107 
  at System.ServiceModel.Dispatcher.DataContractMessagesFormatter.GetSerializer
(System.ServiceModel.Description.MessagePartDescription partDesc) [0x00055] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:448 
  at
System.ServiceModel.Dispatcher.DataContractMessagesFormatter+DataContractBodyWriter.WriteMessagePart
(System.Xml.XmlDictionaryWriter writer,
System.ServiceModel.Description.MessageBodyDescription desc,
System.ServiceModel.Description.MessagePartDescription partDesc, System.Object
obj) [0x00049] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:501 
  at
System.ServiceModel.Dispatcher.DataContractMessagesFormatter+DataContractBodyWriter.OnWriteBodyContents
(System.Xml.XmlDictionaryWriter writer) [0x00091] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs:486 
  at System.ServiceModel.Channels.BodyWriter.WriteBodyContents
(System.Xml.XmlDictionaryWriter writer) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BodyWriter.cs:57 
  at System.ServiceModel.Channels.SimpleMessage.OnWriteBodyContents
(System.Xml.XmlDictionaryWriter writer) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageImpl.cs:331 
  at System.ServiceModel.Channels.Message.WriteBodyContents
(System.Xml.XmlDictionaryWriter writer) [0x00022] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:164 
  at System.ServiceModel.Channels.Message.WriteBody
(System.Xml.XmlDictionaryWriter writer) [0x0001c] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:149 
  at System.ServiceModel.Channels.Message.OnWriteMessage
(System.Xml.XmlDictionaryWriter writer) [0x00065] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:274 
  at System.ServiceModel.Channels.Message.WriteMessage
(System.Xml.XmlDictionaryWriter writer) [0x00026] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:176 
  at System.ServiceModel.Channels.TextMessageEncoder.WriteMessage
(System.ServiceModel.Channels.Message message, System.IO.Stream stream)
[0x00043] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TextMessageEncoder.cs:117 
  at System.ServiceModel.Channels.HttpRequestChannel.BeginProcessRequest
(System.ServiceModel.Channels.HttpChannelRequestAsyncResult result) [0x003a8]
in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs:173 
  at System.ServiceModel.Channels.HttpRequestChannel.BeginRequest
(System.ServiceModel.Channels.Message message, TimeSpan timeout,
System.AsyncCallback callback, System.Object state) [0x00012] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs:315 
  at System.ServiceModel.Channels.HttpRequestChannel.Request
(System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs:72 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request
(System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x0000b] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:582 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request
(System.ServiceModel.Description.OperationDescription od, System.Object[]
parameters) [0x00066] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:537 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess
(System.Reflection.MethodBase method, System.String operationName,
System.Object[] parameters) [0x00038] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:502 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process
(System.Reflection.MethodBase method, System.String operationName,
System.Object[] parameters) [0x0001c] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:479


Is there is any fix for the issue?

        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://mono.1490590.n4.nabble.com/WCF-throwing-System-NullReferenceException-on-multithreaded-application-tp4657659.html" target="_blank">WCF throwing System.NullReferenceException on multithreaded application</a><br>

Sent from the <a href="http://mono.1490590.n4.nabble.com/Mono-Dev-f1517221.html" target="_blank">Mono - Dev mailing list archive</a> at Nabble.com.<br><br>_______________________________________________<br>
Mono-devel-list mailing list<br>
<a href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
<br></blockquote></div><br></div>