MicrosoftResearch/Naiad

Serialization code generation is broken on Mono

mrry opened this issue · 1 comments

mrry commented

It appears that the default behavior of Mono's CodeDOM is to treat warnings as errors, even when the TreatWarningsAsErrors option is set to false. Running Naiad in distributed mode yields the following type of error:

Fatal: errors occurred during the generation of a serializer for type Microsoft.Research.Naiad.Serialization.MessageHeader:
/tmp/4jebzyce.gpz/ReleaseObjects/5b99a60e.0.cs(70,11) : warning CS0219: The variable `bytesRemaining' is assigned but its value is never used
/tmp/4jebzyce.gpz/ReleaseObjects/5b99a60e.0.cs(145,11) : warning CS0219: The variable `bytesRemaining' is assigned but its value is never used
/tmp/4jebzyce.gpz/ReleaseObjects/5b99a60e.0.cs(200,11) : warning CS0219: The variable `bytesRemaining' is assigned but its value is never used


Unhandled Exception:
System.Exception: Code generation for Microsoft.Research.Naiad.Serialization.MessageHeader failed
  at Microsoft.Research.Naiad.Serialization.AutoSerialization+SerializationCodeGeneratorForType.GenerateSerializer[MessageHeader] () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Serialization.BaseSerializationCodeGenerator.GetSerializer[MessageHeader] () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Runtime.Networking.TcpNetworkChannel.get_HeaderSerializer () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Runtime.Networking.TcpNetworkChannel.AnnounceStartup (Int32 barrierId) [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Runtime.Networking.TcpNetworkChannel.DoStartupBarrier () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.BaseController.DoStartupBarrier () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.BaseComputation.Activate () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.InternalOneOffComputation.Activate () [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Examples.Throughput.Throughput.Execute (System.String[] args) [0x00000] in <filename unknown>:0
  at Microsoft.Research.Naiad.Examples.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

The culprit is a stray declaration of a "bytesRemaining" variable in the TrySerializeMany method of each generated serializer.

mrry commented

The "--inlineserializer" option avoids this error, but currently introduces performance regressions for strings (until #8 is fixed).