Bug 39394 - Error running mdoc against dll
Summary: Error running mdoc against dll
Alias: None
Product: Tools
Classification: Mono
Component: Doctools ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-03-06 10:44 UTC by tomf
Modified: 2017-09-01 08:50 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description tomf 2016-03-06 10:44:13 UTC
This might not be the most helpful bug report. If there is any way I can improve it please let me know

I am trying to create documentation for Kerbal space program using mdoc

The full command line is mdoc update -o monoout -L H:\KSP1.0.5\KSP_win\KSP_Data\Managed Assembly\Assembly-CSharp.dll
where Assemble-CSharp.dll is the main library that makes up KSP

It generates hundreds of files but errors with an unhelpful error message

Updating: physicalObject
Updating: PartSelector
New Type: CompoundPart
mdoc: startIndex cannot be larger than length of string.
Parameter name: startIndex
See `mdoc help' for more information.
Comment 1 tomf 2016-03-06 11:15:50 UTC
This behavour is in both the latst release and in the alpha release (32). The 64 bit version failed to run at all.
Comment 2 tomf 2016-03-06 11:21:28 UTC
With debug enabled I am getting a stack trace
New Type: CompoundPart
mdoc: System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
  at System.String.Substring (Int32 startIndex, Int32 length) <0x39e3f40 + 0x000fb> in <filename unknown>:0
  at System.String.Substring (Int32 startIndex) <0x39f36d0 + 0x00023> in <filename unknown>:0
  at Mono.Documentation.ILFullMemberFormatter.GetTypeDeclaration (Mono.Cecil.TypeDefinition type) <0x3a7cf98 + 0x00357> in <filename unknown>:0
  at Mono.Documentation.MemberFormatter.GetDeclaration (Mono.Cecil.MemberReference member) <0x3a76358 + 0x0004f> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.UpdateType (System.Xml.XmlElement root, Mono.Cecil.TypeDefinition type) <0x3a74e30 + 0x00286> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.DoUpdateType2 (System.String message, System.Xml.XmlDocument basefile, Mono.Cecil.TypeDefinition type, System.String output, Boolean insertSince) <0x3a62640 + 0x0013f> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.StubType (Mono.Cecil.TypeDefinition type, System.String output) <0x3ab62e8 + 0x000af> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.DoUpdateType (Mono.Cecil.TypeDefinition type, System.String basepath, System.String dest) <0x3a37ed8 + 0x004af> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.DoUpdateAssembly (Mono.Cecil.AssemblyDefinition assembly, System.Xml.XmlElement index_types, System.String source, System.String dest, System.Collections.Generic.HashSet`1 goodfiles) <0x3a35d28 + 0x000db> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.DoUpdateAssemblies (System.String source, System.String dest) <0x3a12928 + 0x00297> in <filename unknown>:0
  at Mono.Documentation.MDocUpdater.Run (IEnumerable`1 args) <0x3a01018 + 0x00dfb> in <filename unknown>:0
  at Mono.Documentation.MDoc.Run (System.String[] args) <0x39c1470 + 0x00687> in <filename unknown>:0
  at Mono.Documentation.MDoc.Main (System.String[] args) <0x39c0f60 + 0x0003f> in <filename unknown>:0
See `mdoc help' for more information or use --debug to diagnose.
Comment 3 Marek Safar 2017-09-01 08:50:31 UTC
Please retest with latest Mono and if the issue still persist report it at https://github.com/mono/api-doc-tools/issues