[Mono-dev] ArgumentNullException in GetSerializationCallbacks method

Vadim B. Guzev vguzev at yandex.ru
Mon Feb 12 13:41:38 EST 2007


> You should run the application under gdb and try to get a native
> stack trace. See
> 	http://mono-project.com/Debugging#Debugging_with_GDB
> Robert

Robert, thanks for your reply!

Unfortunately I can't debug it. As I have already written in my previous email the program is executed on several clusters and each of them contains a lot of computers. This error occurs only on several nodes and every time these nodes are different (they are even located on different clusters)... I don't know how to make distributed debugging with GDB (and not sure that it is possible). Is it possible to add some null-checkings in method GetSerializationCallbacks? For example, like this:

--8<-------------------------------------------
                public static SerializationCallbacks GetSerializationCallbacks (Type t)
                {
                  if ( t != null ) {
                        lock (cache.SyncRoot) {

                                SerializationCallbacks sc = (SerializationCallbacks)  cache [t];
                                if (sc == null) {
                                        sc = new SerializationCallbacks (t);
                                        cache [t] = sc;
                                }
                                return sc;
                        }
                  }
                  return null;
                }
--8<-------------------------------------------

and in ObjectManager.cs:

--8<-------------------------------------------
#if NET_2_0
                public void RaiseOnDeserializingEvent (object obj)
                {
                        SerializationCallbacks sc = SerializationCallbacks
                                .GetSerializationCallbacks (obj.GetType ());
                     if ( sc != null ) {
                        sc.RaiseOnDeserializing (obj, _context);
                     }
                }

                void RaiseOnDeserializedEvent (object obj)
                {
                        SerializationCallbacks sc = SerializationCallbacks
                                .GetSerializationCallbacks (obj.GetType ());
                     if ( sc != null ) {
                        sc.RaiseOnDeserialized (obj, _context);
                     }
                }
#endif
--8<-------------------------------------------

Does it make sense? What do you think?

Best regards,
Vadim



More information about the Mono-devel-list mailing list