2014-11-21 59 views
1

我正在更新我的項目llvm-fs的工具,所以我安裝了新版本的mono並嘗試編譯它。無論是使用mono 3.10.0與下OS X fsharpc 3.1mono 3.2.8用ubuntu下fsharpc 3.0編譯失敗,堆棧溢出:在單聲道下運行的F#編譯器中的堆棧溢出

git clone [email protected]:fsprojects/llvm-fs.git 
cd llvm-fs/ 
FSC=fsharpc ./build.bash 

Unhandled Exception: 
System.StackOverflowException: The requested operation caused a stack overflow. 
    at (wrapper managed-to-native) object:__icall_wrapper_mono_object_isinst (object,intptr) 
    at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr) 
    at Microsoft.FSharp.Compiler.Driver+DelayedDisposables.System-IDisposable-Dispose() [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.Driver.typecheckAndCompile (System.String[] argv, Boolean bannerAlreadyPrinted, Exiter exiter, Microsoft.FSharp.Compiler.ErrorLoggerProvider errorLoggerProvider) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.Driver.mainCompile (System.String[] argv, Boolean bannerAlreadyPrinted, Exiter exiter) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.CommandLineMain.runMain (System.String[] argv) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.CommandLineMain.main (System.String[] argv) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow. 
    at (wrapper managed-to-native) object:__icall_wrapper_mono_object_isinst (object,intptr) 
    at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr) 
    at Microsoft.FSharp.Compiler.Driver+DelayedDisposables.System-IDisposable-Dispose() [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.Driver.typecheckAndCompile (System.String[] argv, Boolean bannerAlreadyPrinted, Exiter exiter, Microsoft.FSharp.Compiler.ErrorLoggerProvider errorLoggerProvider) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.Driver.mainCompile (System.String[] argv, Boolean bannerAlreadyPrinted, Exiter exiter) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.CommandLineMain.runMain (System.String[] argv) [0x00000] in <filename unknown>:0 
    at Microsoft.FSharp.Compiler.CommandLineMain.main (System.String[] argv) [0x00000] in <filename unknown>:0 

您可以通過以下步驟重現Linux或OS X此錯誤

在windows下fsc 12.0.30815.0編譯完成沒有任何錯誤:

fsc --nologo --debug --sig:LLVMFSharp.fsi --target:library --out:LLVMFSharp.dll src/LLVM/FFIUtil.fs src/LLVM/Generated.fs src/LLVM/Core.fs src/LLVM/BitReader.fs src/LLVM/ExecutionEngine.fs src/LLVM/Extra.fs src/LLVM/Target.fs src/LLVM/Quote.fs 

這是一個已知的問題,有什麼辦法可以解決它嗎?我試過將不同的選項傳遞給mono運行時,並且沒有導致編譯器正常退出。我記得在過去,單聲道在遵守尾聲指示方面遇到了一些問題,但我認爲這些問題已經基本解決了。謝謝!

+0

我忘了說這個編譯和F#2.0編譯器附帶的舊單聲道一起工作正常(但我不確定它的確切版本)。 – Keith 2014-11-21 03:54:59

+0

這看起來像編譯器中的迴歸。我會將其報告爲一個錯誤。 – 2014-11-21 04:34:29

+0

萬一有人在這裏跟着這個是bug報告https://bugzilla.xamarin.com/show_bug.cgi?id=24752 – Keith 2014-11-23 01:30:15

回答

1

這對評論來說太長了,但是這個錯誤是由generated.fs中的這段代碼觸發的(在註釋中它會停止堆棧溢出 - 一旦這個註釋被註釋掉,就會出錯)行6496-6506):

[<DllImport(
      llvmAssemblyName, 
      EntryPoint="LLVMRunFunction", 
      CallingConvention=CallingConvention.Cdecl, 
      CharSet=CharSet.Ansi)>] 
     extern void* (* LLVMGenericValueRef *) runFunctionNative(
      void* (* LLVMExecutionEngineRef *) EE, 
      void* (* LLVMValueRef *) F, 
      uint32 NumArgs, 
      void* (* LLVMGenericValueRef* *) Args) 
     // I don't know how to generate an "F# friendly" version of LLVMRunFunction 

崩潰發生在輸出簽名文件的代碼中。

禁用簽名文件修復了問題(但仍然存在潛在的問題)。

+0

謝謝指針和工作。關閉簽名文件生成對我來說是一個很好的解決方法,特別是因爲我可以使用windows build的簽名輸出。我會在你花費一點時間的時候向你提供一個bug報告。 – Keith 2014-11-21 17:22:48