Bug 60467 - F# Compiler Regression when writing PDB files FS0193 : internal error
Summary: F# Compiler Regression when writing PDB files FS0193 : internal error
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: msbuild ()
Version: 5.4 (2017-06)
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Jason Imison
URL:
Depends on:
Blocks:
 
Reported: 2017-11-01 01:28 UTC by Frank A. Krueger
Modified: 2018-01-01 15:54 UTC (History)
5 users (show)

Tags:
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 for Bug 60467 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Frank A. Krueger 2017-11-01 01:28:56 UTC
I have been compiling an F# library for over a year but a recent update to Xamarin now fails to compile. It gives the below error.

If I disable debug symbols, then it works. However, this make debugging difficult.
    
    error FS0193 : internal error : Specified argument was out of the range of valid values.Parameter name: value
    
    Unhandled Exception:
    System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
    Parameter name: value
      at System.Reflection.Throw.ValueArgumentOutOfRange () [0x00000] in <6e996dbb3f9b4d42bb708be9f37ced22>:0 
      at System.Reflection.Metadata.BlobWriterImpl.WriteCompressedInteger (System.Reflection.Metadata.BlobBuilder writer, System.UInt32 value) [0x0003b] in <6e996dbb3f9b4d42bb708be9f37ced22>:0 
      at System.Reflection.Metadata.BlobBuilder.WriteCompressedInteger (System.Int32 value) [0x00000] in <6e996dbb3f9b4d42bb708be9f37ced22>:0 
      at Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter.generatePortablePdb$cont@341 (Microsoft.FSharp.Compiler.AbstractIL.IL+ILSourceDocument[] docs, System.Reflection.Metadata.Ecma335.MetadataBuilder metadata, System.Collections.Generic.Dictionary`2[TKey,TValue] documentIndex, Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter+PdbSequencePoint[] sps, System.Reflection.Metadata.BlobBuilder builder, Microsoft.FSharp.Core.Unit unitVar) [0x0018f] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter.f@1-13 (Microsoft.FSharp.Compiler.AbstractIL.IL+ILSourceDocument[] docs, System.Reflection.Metadata.Ecma335.MetadataBuilder metadata, System.Collections.Generic.Dictionary`2[TKey,TValue] documentIndex, Microsoft.FSharp.Core.FSharpRef`1[T] lastLocalVariableHandle, Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter+PdbMethodData minfo) [0x00075] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter.generatePortablePdb (System.Boolean embedAllSource, Microsoft.FSharp.Collections.FSharpList`1[T] embedSourceList, System.String sourceLink, System.Boolean showTimes, Microsoft.FSharp.Compiler.AbstractIL.ILPdbWriter+PdbData info, System.Boolean isDeterministic) [0x002a5] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter.writeBinaryAndReportMappings (System.String outfile, Microsoft.FSharp.Compiler.AbstractIL.IL+ILGlobals ilg, Microsoft.FSharp.Core.FSharpOption`1[T] pdbfile, Microsoft.FSharp.Core.FSharpOption`1[T] signer, System.Boolean portablePDB, System.Boolean embeddedPDB, System.Boolean embedAllSource, Microsoft.FSharp.Collections.FSharpList`1[T] embedSourceList, System.String sourceLink, System.Boolean emitTailcalls, System.Boolean deterministic, System.Boolean showTimes, System.Boolean dumpDebugInfo, Microsoft.FSharp.Compiler.AbstractIL.IL+ILModuleDef modul) [0x019b3] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter.WriteILBinary (System.String filename, Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter+options options, Microsoft.FSharp.Compiler.AbstractIL.IL+ILModuleDef input) [0x00001] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.Driver.main4[a] (Microsoft.FSharp.Core.FSharpOption`1[T] dynamicAssemblyCreator, Microsoft.FSharp.Compiler.Driver+Args`1[T] _arg1) [0x00189] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ReraiseIfWatsonable (System.Exception exn) [0x00040] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.ErrorRecovery (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x000d2] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.Driver.main4[a] (Microsoft.FSharp.Core.FSharpOption`1[T] dynamicAssemblyCreator, Microsoft.FSharp.Compiler.Driver+Args`1[T] _arg1) [0x001ae] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.Driver.typecheckAndCompile (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, System.String[] argv, Microsoft.FSharp.Compiler.ReferenceResolver+Resolver legacyReferenceResolver, System.Boolean bannerAlreadyPrinted, System.Boolean openBinariesInMemory, System.Boolean defaultCopyFSharpCore, Microsoft.FSharp.Compiler.ErrorLogger+Exiter exiter, Microsoft.FSharp.Compiler.Driver+ErrorLoggerProvider loggerProvider, Microsoft.FSharp.Core.FSharpOption`1[T] tcImportsCapture, Microsoft.FSharp.Core.FSharpOption`1[T] dynamicAssemblyCreator) [0x00039] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.Driver.mainCompile (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, System.String[] argv, Microsoft.FSharp.Compiler.ReferenceResolver+Resolver legacyReferenceResolver, System.Boolean bannerAlreadyPrinted, System.Boolean openBinariesInMemory, System.Boolean defaultCopyFSharpCore, Microsoft.FSharp.Compiler.ErrorLogger+Exiter exiter, Microsoft.FSharp.Compiler.Driver+ErrorLoggerProvider loggerProvider, Microsoft.FSharp.Core.FSharpOption`1[T] tcImportsCapture, Microsoft.FSharp.Core.FSharpOption`1[T] dynamicAssemblyCreator) [0x00001] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.CommandLineMain+Driver.main (System.String[] argv) [0x0003e] in <59c44fc0c960099ba7450383c04fc459>:0 
      at Microsoft.FSharp.Compiler.CommandLineMain.main (System.String[] argv) [0x00042] in <59c44fc0c960099ba7450383c04fc459>:0 
      at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ReraiseIfWatsonable (System.Exception exn) [0x00040] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.ErrorRecovery (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x000d2] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.ErrorLogger.errorRecovery (System.Exception exn, Microsoft.FSharp.Compiler.Range+range m) [0x00006] in <59c44fb6f1806346a7450383b64fc459>:0 
      at Microsoft.FSharp.Compiler.CommandLineMain.main (System.String[] argv) [0x00056] in <59c44fc0c960099ba7450383c04fc459>:0 


=== Visual Studio Enterprise 2017 for Mac ===

Version 7.2 (build 636)
Installation UUID: cb277521-bd56-48ba-89fd-2659678ff1e7
Runtime:
	Mono 5.4.0.201 (2017-06/71277e78f6e) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504000201

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0-preview2-25407-01
	2.0.0-preview1-002111-00
	1.1.2
	1.1.1
	1.0.5
	1.0.4
	1.0.1
	1.0.0-rc2-3002702
SDK: /usr/local/share/dotnet/sdk/2.0.0-preview2-006497/Sdks
SDK Versions:
	2.0.0-preview2-006497
	2.0.0-preview1-005977
	1.0.4
	1.0.1
	1.0.0-preview2-003131
	1.0.0-preview1-002702
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Enterprise)
Android SDK: /Users/fak/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 9.0 (13247)
Build 9A235

=== Xamarin.iOS ===

Version: 11.2.0.11 (Visual Studio Enterprise)
Hash: 2f8bbec0
Branch: d15-4-xi
Build date: 2017-10-05 20:56:05-0400

=== Xamarin.Mac ===

Version: 3.8.0.49 (Visual Studio Enterprise)

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 702000636
Git revision: b349c8fc0c2e1aab0179917d56eed75eb3a03337
Build date: 2017-10-06 15:20:04-04
Xamarin addins: a8da992c78f7eb65b3cdb3f951c34a30337cab35
Build lane: monodevelop-lion-d15-4

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

AddinMaker 1.4.1
Comment 1 Jason Imison 2017-11-02 17:09:40 UTC
Hi Frank

I switched the default debugging format over to portable pdb debugging. It was previously using Mono's mdb format.

The mdb format will be deprecated soon, but looks like there are some issues with the F# compiler when generating ppdb. I don't suppose that you have a small repro by any chance? It will need to be reported on https://github.com/microsoft/visualfsharp

Luckily, I added a failsafe mechanism in case there were any issues - try adding the following to your fsproj file :-

```
<FscDebugType>full</FscDebugType>
<FscDebugFileExt>.mdb</FscDebugFileExt>
```
Comment 3 Frank A. Krueger 2017-11-02 17:15:49 UTC
Jason, as a side note, the project settings dialog no longer works when setting F# debug options. I have to manually edit the fsproj as changes in the GUI editor don't perform the edits.
Comment 4 Frank A. Krueger 2017-11-02 17:23:08 UTC
I submitted: https://github.com/Microsoft/visualfsharp/issues/3866
Comment 5 Jason Imison 2017-11-02 18:07:51 UTC
Thanks, I'll take a look at the project settings dialog.
Comment 8 Jason Imison 2017-12-22 11:08:24 UTC
*** Bug 61091 has been marked as a duplicate of this bug. ***