WebSharper

Hello, I try to run this code:

1
2
3
4
5
6
7
8
let MySite =
    Warp.CreateSPA (fun ctx ->
        [
            H1 [Text "Say Hi to the server"]
        ])

[<EntryPoint>]
do Warp.RunAndWaitForInput(MySite, debug=true) |> ignore

OS: Ubuntu 16.04 Mono version: 4.8 F# version: 4.1 And get this error:

  • Assertion at custom-attrs.c:1860, condition `!imageisdynamic (image)' not met

Stacktrace:

at <0xffffffff > at (wrapper managed-to-native) System.Type.internalfromname (string,bool,bool) <0x0005d > at System.Type.GetType (string,bool) <0x0002e > at WebSharper.Core.Reflection/Type.Load (Microsoft.FSharp.Core.FSharpOption1<bool>) <0x000a3> at WebSharper.Compiler.Verifier/-ctor@66-60.Invoke (WebSharper.Core.Reflection/Type) <0x0007f> at WebSharper.Compiler.Verifier/clo@53.Invoke (WebSharper.Core.Reflection/Type) <0x000d2> at WebSharper.Compiler.Verifier/-ctor@65-61.Invoke (WebSharper.Compiler.ReflectionLayer/TypeReference) <0x00034> at WebSharper.Compiler.Verifier/State.getRemoteContractError (WebSharper.Compiler.ReflectionLayer/MethodDefinition) <0x00158> at WebSharper.Compiler.Verifier/State.VerifyRemoteMethod (WebSharper.Compiler.ReflectionLayer/MethodDefinition) <0x0001b> at WebSharper.Compiler.Validator.pPropMethodKind@438 (WebSharper.Compiler.Reflector/Pool,WebSharper.Compiler.Verifier/State,Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Core.FSharpFunc2<WebSharper.Compiler.Location, Microsoft.FSharp.Core.FSharpFunc2>,bool,bool,WebSharper.Compiler.Inlining/Pool,WebSharper.Compiler.Reflector/Member1<WebSharper.Compiler.ReflectionLayer/MethodDefinition>) <0x001f7> at WebSharper.Compiler.Validator/pMethod@561-1.Invoke (WebSharper.Compiler.Reflector/Member1) <0x0004f > at Microsoft.FSharp.Primitives.Basics.List.choose (Microsoft.FSharp.Core.FSharpFunc2<T_REF, Microsoft.FSharp.Core.FSharpOption1>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x00053> at Microsoft.FSharp.Collections.ListModule.Choose<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x0002f> at WebSharper.Compiler.Validator/pType@694-1.Invoke (WebSharper.Compiler.Reflector/Type) <0x0103b> at Microsoft.FSharp.Primitives.Basics.List.choose<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x00053> at Microsoft.FSharp.Collections.ListModule.Choose<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x0002f> at WebSharper.Compiler.Validator/pType@694-1.Invoke (WebSharper.Compiler.Reflector/Type) <0x010a7> at Microsoft.FSharp.Primitives.Basics.List.chooseToFreshConsTail<a_REF, b_REF> (Microsoft.FSharp.Collections.FSharpList1,Microsoft.FSharp.Core.FSharpFunc2<b_REF, Microsoft.FSharp.Core.FSharpOption1>,Microsoft.FSharp.Collections.FSharpList1<b_REF>) <0x00053> at Microsoft.FSharp.Primitives.Basics.List.choose<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x000d7> at Microsoft.FSharp.Collections.ListModule.Choose<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc2>,Microsoft.FSharp.Collections.FSharpList1<T_REF>) <0x0002f> at WebSharper.Compiler.Validator.Validate (WebSharper.Compiler.Logger,WebSharper.Compiler.Inlining/Pool,WebSharper.Compiler.Reflector/Pool,Microsoft.FSharp.Core.FSharpFunc2>,WebSharper.Compiler.Reflector/Assembly) <0x001a3 > at WebSharper.Compiler.FrontEnd/Compiler.CompileAssembly (WebSharper.Compiler.ReflectionLayer/AssemblyDefinition,bool,bool) <0x00207 > at WebSharper.Compiler.FrontEnd/Compiler.Compile (System.Reflection.Assembly,Microsoft.FSharp.Core.FSharpOption1<bool>,Microsoft.FSharp.Core.FSharpOption1) <0x0019b > at WebSharper.Compilation.compile (System.Reflection.Assembly) <0x001e7 > at WebSharper.Owin/compile@217-1.Invoke (System.Reflection.Assembly) <0x00013 > at WebSharper.Owin/WarpMiddleware1<EndPoint_REF>..ctor (System.Func2, System.Threading.Tasks.Task>,WebSharper.Sitelets.Sitelet1<EndPoint_REF>,WebSharper.Owin/WarpOptions1) <0x000d8 > at WebSharper.Owin/UseWarp@245.Invoke (System.Func2<System.Collections.Generic.IDictionary2, System.Threading.Tasks.Task>) <0x00067 > at (wrapper runtime-invoke) .runtimeinvokeobjectthisobject (object,intptr,intptr,intptr) <0x000da > at <0xffffffff > at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object,System.Exception&) <0x0006c > at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object,System.Globalization.CultureInfo) <0x000a1 > at System.Reflection.MethodBase.Invoke (object,object) <0x0002a > at System.Delegate.DynamicInvokeImpl (object) <0x00255 > at System.MulticastDelegate.DynamicInvokeImpl (object) <0x00035 > at System.Delegate.DynamicInvoke (object) <0x00019 > at Microsoft.Owin.Builder.AppBuilder.BuildInternal (System.Type) <0x00146 > at Microsoft.Owin.Builder.AppBuilder.Build (System.Type) <0x00013 > at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create (Owin.IAppBuilder) <0x000f8 > at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer (Microsoft.Owin.Hosting.Engine.StartContext) <0x00029 > at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext) <0x0015b > at Microsoft.Owin.Hosting.WebApp.StartImplementation (System.IServiceProvider,Microsoft.Owin.Hosting.StartOptions,System.Action1<Owin.IAppBuilder>) <0x00161> at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions,System.Action1) <0x00027 > at WebSharper.Warp.Run<EndPointREF> (WebSharper.Sitelets.Sitelet1<EndPoint_REF>,Microsoft.FSharp.Core.FSharpOption1,Microsoft.FSharp.Core.FSharpOption1<Microsoft.FSharp.Collections.FSharpList1>,Microsoft.FSharp.Core.FSharpOption1<string>,Microsoft.FSharp.Core.FSharpOption1,Microsoft.FSharp.Core.FSharpOption1<System.Reflection.Assembly>) <0x00333> at WebSharper.Warp.RunAndWaitForInput<EndPoint_REF> (WebSharper.Sitelets.Sitelet1,Microsoft.FSharp.Core.FSharpOption1<bool>,Microsoft.FSharp.Core.FSharpOption1>,Microsoft.FSharp.Core.FSharpOption1<string>,Microsoft.FSharp.Core.FSharpOption1,Microsoft.FSharp.Core.FSharpOption1<System.Reflection.Assembly>) <0x000cb> at <StartupCode$FSI_0004>.$FSI_0004.main@ () <0x00097> at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x000ba> at <unknown> <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x0006c> at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000a1> at System.RuntimeType.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,string[]) <0x00f0a> at System.Reflection.Emit.TypeBuilder.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,string[]) <0x00069> at System.Type.InvokeMember (string,System.Reflection.BindingFlags,System.Reflection.Binder,object,object[],System.Globalization.CultureInfo) <0x0005e> at Microsoft.FSharp.Compiler.AbstractIL.ILRuntimeWriter/execEntryPtFun@2014-1.Invoke (Microsoft.FSharp.Core.Unit) <0x0009e> at Microsoft.FSharp.Compiler.Interactive.Shell/clo@895-37.Invoke (Microsoft.FSharp.Core.FSharpFunc2>) <0x00022 > at Microsoft.FSharp.Primitives.Basics.List.iter (Microsoft.FSharp.Core.FSharpFunc2<T_REF, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Collections.FSharpList1) <0x00047 > at Microsoft.FSharp.Collections.ListModule.Iterate (Microsoft.FSharp.Core.FSharpFunc2<T_REF, Microsoft.FSharp.Core.Unit>,Microsoft.FSharp.Collections.FSharpList1) <0x0002f > at Microsoft.FSharp.Compiler.Interactive.Shell.arg10@894 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler,Microsoft.FSharp.Collections.FSharpList1<Microsoft.FSharp.Core.FSharpFunc2>>,Microsoft.FSharp.Core.Unit) <0x0006f > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler.ProcessInputs (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Collections.FSharpList1<Microsoft.FSharp.Compiler.Ast/ParsedInput>,bool,bool,bool,Microsoft.FSharp.Collections.FSharpList1) <0x00777 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompiler.EvalParsedDefinitions (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,bool,bool,Microsoft.FSharp.Collections.FSharpList1<Microsoft.FSharp.Compiler.Ast/SynModuleDecl>) <0x0022f> at Microsoft.FSharp.Compiler.Interactive.Shell/clo@1644-45.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x01923> at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<a_REF> (Microsoft.FSharp.Core.FSharpFunc2>,aREF) <0x00049 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ExecInteraction (bool,Microsoft.FSharp.Compiler.CompileOps/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Compiler.Ast/ParsedFsiInteraction) <0x00073 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ExecInteractions (bool,Microsoft.FSharp.Compiler.CompileOps/TcConfig,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Core.FSharpOption1<Microsoft.FSharp.Compiler.Ast/ParsedFsiInteraction>) <0x00a7f> at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.MainThreadProcessParsedInteraction (bool,Microsoft.FSharp.Core.FSharpOption1,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0019f > at Microsoft.FSharp.Compiler.Interactive.Shell/res@1861.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0002f > at Microsoft.FSharp.Compiler.Interactive.Shell/run@1878-1.Invoke (Microsoft.FSharp.Core.FSharpFunc2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, System.Tuple2>,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0001d > at Microsoft.FSharp.Core.OptimizedClosures/Invoke@3260<T2REF, TResultREF, T1REF>.Invoke (T2REF) <0x00029 > at Microsoft.FSharp.Compiler.Interactive.Shell/ParseAndProcessAndEvalOneInteractionFromLexbuf@1850.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x001d8 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<aREF> (Microsoft.FSharp.Core.FSharpFunc2<a_REF, System.Tuple2>,aREF) <0x00049 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.ParseAndProcessAndEvalOneInteractionFromLexbuf (bool,Microsoft.FSharp.Core.FSharpFunc2<Microsoft.FSharp.Core.FSharpFunc2>, Microsoft.FSharp.Core.FSharpFunc2<Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState, System.Tuple2>>,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Compiler.LexFilter/LexFilter) <0x00173 > at Microsoft.FSharp.Compiler.Interactive.Shell.run@1877 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor,bool,Microsoft.FSharp.Compiler.LexFilter/LexFilter,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0006f > at Microsoft.FSharp.Compiler.Interactive.Shell/EvalIncludedScript@1873.Invoke (Microsoft.FSharp.Core.Unit) <0x00047 > at Microsoft.FSharp.Compiler.Interactive.Shell.WithImplicitHome<aREF> (Microsoft.FSharp.Compiler.CompileOps/TcConfigBuilder,string,Microsoft.FSharp.Core.FSharpFunc2<Microsoft.FSharp.Core.Unit, a_REF>) <0x0004a> at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.EvalIncludedScript (bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,string,Microsoft.FSharp.Compiler.Range/range) <0x000bf> at Microsoft.FSharp.Compiler.Interactive.Shell/EvalIncludedScripts@1897.Invoke (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x00043> at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.InteractiveCatch<a_REF> (Microsoft.FSharp.Core.FSharpFunc2>,aREF) <0x00049 > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.EvalIncludedScripts (Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,bool,Microsoft.FSharp.Collections.FSharpList1<string>) <0x00093> at Microsoft.FSharp.Compiler.Interactive.Shell.consume@1907 (Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor,bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState,Microsoft.FSharp.Collections.FSharpList1>) <0x000fb > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiInteractionProcessor.LoadInitialFiles (bool,Microsoft.FSharp.Compiler.Interactive.Shell/FsiDynamicCompilerState) <0x0002f > at Microsoft.FSharp.Compiler.Interactive.Shell/FsiEvaluationSession.Run () <0x00ecb > at Microsoft.FSharp.Compiler.Interactive.Shell.evaluateSession@2520 (string,Microsoft.FSharp.Core.Unit) <0x000bb > at Microsoft.FSharp.Compiler.Interactive.Shell.MainMain (string) <0x001cf > at Microsoft.FSharp.Compiler.Interactive.Main.FsiMain (string) <0x0000f > at (wrapper runtime-invoke) .runtimeinvokeintobject (object,intptr,intptr,intptr) <0x000f5 >

Native stacktrace:

/usr/bin/mono() 0x4b103a /lib/x8664-linux-gnu/libpthread.so.0(+0x11390) 0x7efc39e1a390 /lib/x8664-linux-gnu/libc.so.6(gsignal+0x38) 0x7efc3985f428 /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) 0x7efc3986102a /usr/bin/mono() 0x64f9b9 /usr/bin/mono() 0x6663f8 /usr/bin/mono() 0x666556 /usr/bin/mono() 0x5ee390 /usr/bin/mono() 0x525a97 /usr/bin/mono() 0x5287bf /usr/bin/mono() 0x553a96 0x40d0877e

Debug info from gdb:

Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf ptrace: Operation not permitted. No threads.

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.