Zyan icon indicating copy to clipboard operation
Zyan copied to clipboard

Null reference exception when running WhisperChat(sample app) on Mono Version 5.16

Open marzim opened this issue 6 years ago • 2 comments

Hi @yallie ,

Tried to run the WhisperChat(sample app) on Linux(Opensuse) box with Mono version 5.16. Server run just fine but Client crash during MainForm_Show `Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object

Server stack trace: at System.Security.Principal.WindowsIdentity.System.Runtime.Serialization.IDeserializationCallback.OnDeserialization (System.Object sender) [0x00000] in <773ec02b42f74a918ccd74911c8063c9>:0 at System.Runtime.Serialization.ObjectManager.RaiseDeserializationEvent () [0x00021] in <773ec02b42f74a918ccd74911c8063c9>:0`

BTW I'm using the latest version.

Any inputs are much appreciated.

Thanks.

marzim avatar Jul 01 '19 12:07 marzim

Hi @marzim

Didn't try running Zyan on Linux for a couple of years, sorry. Looks like there's an issue with WindowsIdentity deserialization under Mono. Not sure why it pops up in Zyan example that doesn't use authentication...

yallie avatar Jul 10 '19 17:07 yallie

Hi @yallie ,

I have same problem with xamarin android on visual studio 2022 community at this line : var connection = new ZyanConnection("tcpex://DB-PORTABLE2:12345/Sample", protocol);

System.NullReferenceException Message=Object reference not set to an instance of an object.

here is the stacktrace :

Server stack trace: 
  at System.Security.Principal.WindowsIdentity.System.Runtime.Serialization.IDeserializationCallback.OnDeserialization (System.Object sender) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Security.Principal/WindowsIdentity.cs:265 
  at System.Runtime.Serialization.ObjectManager.RaiseDeserializationEvent () [0x00021] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/serialization/objectmanager.cs:1100 
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x0010d] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectreader.cs:206 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00099] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs:197 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs:173 
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.DeserializeMethodResponse (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs:155 
  at Zyan.SafeDeserializationHelpers.Channels.SafeBinaryClientFormatterSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg) [0x00083] in <6859c22e88514256b5fb29f77c07e826>:0 

Exception rethrown at [0]: 
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, System.Runtime.Remoting.Messaging.IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00146] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:306 

Thanks

BanzaiGit avatar Jun 01 '22 11:06 BanzaiGit