OmniSharp / omnisharp-server

HTTP wrapper around NRefactory allowing C# editor plugins to be written in any language.
http://www.omnisharp.net
MIT License
380 stars 97 forks source link

SIGSEGV when starting Omnisharp.exe #191

Closed jtbm37 closed 9 years ago

jtbm37 commented 9 years ago

I installed Ubuntu 14.04 (linux header 3.16.0-30-generic) in VirtualBox VM on the 11th of April 2015.

Installed omnisharp-vim and followed installation instructions. Everything was working.

The following day Ubuntu prompted a system upgrade for the newer linux kernel 3.16.0-34-generic.

All other packages including mono is up-to-date.

However when starting OmniSharp.exe I now get the following error:

> mono ~/.vim/bundle/omnisharp-vim/server/OmniSharp/bin/Debug/OmniSharp.exe -p 2000 -s '/home/matrix/Projects/demo/demo.sln'

00000061 Using solution path /home/matrix/Projects/demo/demo.sln
00000070 Using config file /home/matrix/.vim/bundle/omnisharp-vim/server/OmniSharp/bin/Debug/config.json
Stacktrace:

at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr) <0xffffffff>
at (wrapper alloc) object.AllocVector (intptr,intptr) <0xffffffff>
at System.Collections.Generic.Dictionary`2.Resize () <0x0004b>
at System.Collections.Generic.Dictionary`2.Add (TKey,TValue) <0x0018f>
at Mono.CSharp.Namespace.AddType (Mono.CSharp.ModuleContainer,Mono.CSharp.TypeSpec) <0x00633>
at Mono.CSharp.MetadataImporter.ImportTypes (System.Type[],Mono.CSharp.Namespace,bool) <0x0023b>
at Mono.CSharp.ReflectionImporter.ImportAssembly (System.Reflection.Assembly,Mono.CSharp.RootNamespace) <0x000a3>
at Microsoft.CSharp.RuntimeBinder.DynamicContext.Create () <0x00267>
at Microsoft.CSharp.RuntimeBinder.CSharpGetIndexBinder.FallbackGetIndex (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject[],System.Dynamic.DynamicMetaObject) <0x0006f>
at System.Dynamic.GetIndexBinder.FallbackGetIndex (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject[]) <0x00020>
at System.Dynamic.DynamicMetaObject.BindGetIndex (System.Dynamic.GetIndexBinder,System.Dynamic.DynamicMetaObject[]) <0x00043>
at System.Dynamic.DynamicObject/MetaDynamic.BindGetIndex (System.Dynamic.GetIndexBinder,System.Dynamic.DynamicMetaObject[]) <0x001af>
at System.Dynamic.GetIndexBinder.Bind (System.Dynamic.DynamicMetaObject,System.Dynamic.DynamicMetaObject[]) <0x0005f>
at System.Dynamic.DynamicMetaObjectBinder.Bind (object[],System.Collections.ObjectModel.ReadOnlyCollection`1<System.Linq.Expressions.ParameterExpression>,System.Linq.Expressions.LabelTarget) <0x001ac>
at System.Runtime.CompilerServices.CallSiteBinder.BindCore<T> (System.Runtime.CompilerServices.CallSite`1<T>,object[]) <0x000a1>
at System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0, T1, TRet> (System.Runtime.CompilerServices.CallSite,T0,T1) <0x004c3>
at Nancy.Conventions.BuiltInCultureConventions.FormCulture (Nancy.NancyContext) <0x0026d>
at Nancy.Culture.DefaultCultureService.DetermineCurrentCulture (Nancy.NancyContext) <0x0006a>
at Nancy.DefaultNancyContextFactory.Create (Nancy.Request) <0x000c1>
at Nancy.Routing.RouteCache..ctor (Nancy.INancyModuleCatalog,Nancy.INancyContextFactory,Nancy.Routing.IRouteSegmentExtractor,Nancy.Routing.IRouteDescriptionProvider,Nancy.Culture.ICultureService,System.Collections.Generic.IEnumerable`1<Nancy.Routing.IRouteMetadataProvider>) <0x0011b>
at Nancy.Diagnostics.DiagnosticsHook.Enable (Nancy.Diagnostics.DiagnosticsConfiguration,Nancy.Bootstrapper.IPipelines,System.Collections.Generic.IEnumerable`1<Nancy.Diagnostics.IDiagnosticsProvider>,Nancy.IRootPathProvider,Nancy.Diagnostics.IRequestTracing,Nancy.Bootstrapper.NancyInternalConfiguration,Nancy.ModelBinding.IModelBinderLocator,System.Collections.Generic.IEnumerable`1<Nancy.Responses.Negotiation.IResponseProcessor>,System.Collections.Generic.IEnumerable`1<Nancy.Routing.Constraints.IRouteSegmentConstraint>,Nancy.Culture.ICultureService,Nancy.Diagnostics.IRequestTraceFactory,System.Collections.Generic.IEnumerable`1<Nancy.Routing.IRouteMetadataProvider>,Nancy.Localization.ITextResource) <0x00187>
at Nancy.Diagnostics.DefaultDiagnostics.Initialize (Nancy.Bootstrapper.IPipelines) <0x00097>
at Nancy.Bootstrapper.NancyBootstrapperBase`1.Initialise () <0x00564>
at Nancy.Hosting.Self.NancyHost..ctor (Nancy.Bootstrapper.INancyBootstrapper,Nancy.Hosting.Self.HostConfiguration,System.Uri[]) <0x00101>
at OmniSharp.Program.StartServer (string,string,int,OmniSharp.Verbosity,string) <0x0039b>
at OmniSharp.Program.Main (string[]) <0x005af>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

    Native stacktrace:

    mono() [0x4accac]
    mono() [0x50451f]
    mono() [0x42a7c7]
    /cdrom/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f82eb288340]
    mono()[0x5e718b]
    mono() [0x5e7ee2]
    mono() [0x5c7458]
    mono() [0x5cc22e]
    mono() [0x5cc89d]
    mono() [0x5dfe05]
    mono() [0x5dffeb]
    [0x41b0297e]

    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 SIGSEGV while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries 
    used by your application.
    =================================================================

    zsh: abort (core dumped)  mono ~/.vim/bundle/omnisharp-vim/server/OmniSharp/bin/Debug/OmniSharp.exe -p 

I believe there is a race condition somewhere as it might work 1 out of 10 attempts. The stacktrace is also different when it fails but this one is the most detailed. Sometimes the stacktrace may even be empty (it probably fails too early?). Note that in all cases it fails before it finishes parsing/loading the solution.

Fortunately I can use GRUB2 to boot with the previous kernel (3.16.0-30-generic) with which I cannot reproduce this issue.

Extra info:

>uname -a
Linux matrix-linux 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>mono --version
Linux matrix-linux 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Mono JIT compiler version 3.12.1 (tarball Fri Mar  6 19:12:47 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen