[Mono-bugs] [Bug 430583] New: BinaryFormatter: IObjectReferences are not serialized correctly

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 29 06:53:24 EDT 2008


           Summary: BinaryFormatter: IObjectReferences are not serialized
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: lluis at novell.com
        ReportedBy: robertj at gmx.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

When a class is containing a field of a class which in turn is serialized using
a IObjectReference surrogate, the type of the field must be changed to reflect
the new type as it was set by the surrogate.

Run the attach test case and inspect the generated file:

The type of the field "Aggregator.TheSubject" is "Subject" instead of

MS.NET's binary formatter is (1) always emitting the changed type but it's
still able to consume mono's output (2) because it seems to ignore the type of
the field. I've tested this by poisoning the mono-generated dump file with an
unknown type for TheSubject.

Given how mono's ObjectWriter is implemented, patching the field type a
posteriori is not an option because mono is heavily caching the metadata and
it's even emitting optimized and static IL in some cases.

Lluis, any idea how to proceed? I'd vote for (2) which means to change
ObjectReader to ignore the type of the field, like MS.NET does.

I believe (1) would require to rewrite large parts of ObjectWriter.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list