Bug 59255 - mono crash
Summary: mono crash
Status: NEEDINFO
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 5.2
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-06 13:26 UTC by Enrico Sada
Modified: 2017-09-22 20:05 UTC (History)
3 users (show)

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


Attachments

Description Enrico Sada 2017-09-06 13:26:41 UTC
doesnt crash always, but sometimes

ref https://github.com/fsharp/FsAutoComplete/issues/211

reproduced on travis ci

os: Ubuntu 14.04.5 LTS
mono: 5.2.0.215 but seen that also on 5.0.x and also 5.4.x


```
+Stacktrace:
+null
+  at <unknown> <0xffffffff>
+  at (wrapper managed-to-native) System.Delegate.CreateDelegate_internal (System.Type,object,System.Reflection.MethodInfo,bool) [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Delegate.CreateDelegate (System.Type,object,System.Reflection.MethodInfo,bool,bool) [0x002f0] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Delegate.CreateDelegate (System.Type,System.Reflection.MethodInfo,bool) [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Delegate.CreateDelegate (System.Type,System.Reflection.MethodInfo) [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type) [0x00029] in <204f770036d441bb8dfd3daba3550e83>:0
+  at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateParameterizedConstructor (System.Reflection.MethodBase) [0x0003e] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type) [0x00152] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type) [0x00100] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type) [0x00029] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (object) [0x00016] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter,object,System.Type) [0x00028] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter,object,System.Type) [0x00253] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter,object,System.Type) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (object,System.Type,Newtonsoft.Json.JsonSerializer) [0x00028] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.JsonConvert.SerializeObject (object,System.Type,Newtonsoft.Json.JsonSerializerSettings) [0x00007] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at Newtonsoft.Json.JsonConvert.SerializeObject (object) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
+  at <StartupCode$FsAutoComplete-Core>.$Project/r@31.Invoke (FsAutoComplete.ProjectCrackerCache) [0x00001] in <59afe7f8f78c97f6a7450383f8e7af59>:0
+  at Microsoft.FSharp.Core.OptionModule.Map<T_REF, TResult_REF> (Microsoft.FSharp.Core.FSharpFunc`2<T_REF, TResult_REF>,Microsoft.FSharp.Core.FSharpOption`1<T_REF>) [0x0000d] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at <StartupCode$FsAutoComplete-Core>.$Project/loop@29-12<a_REF>.Invoke (FsAutoComplete.ProjectPersistentCacheMessage) [0x0002d] in <59afe7f8f78c97f6a7450383f8e7af59>:0
+  at Microsoft.FSharp.Control.AsyncBuilderImpl/args@835-1<a_REF, b_REF>.Invoke (a_REF) [0x00016] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at Microsoft.FSharp.Control.AsyncBuilderImpl/resultA@817<a_REF>.Invoke (Microsoft.FSharp.Control.AsyncParams`1<a_REF>) [0x00066] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at Microsoft.FSharp.Control.AsyncBuilderImpl/callA@851<b_REF, a_REF>.Invoke (Microsoft.FSharp.Control.AsyncParams`1<b_REF>) [0x0012e] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at Microsoft.FSharp.Control.AsyncBuilderImpl/args@835-1<bool, FsAutoComplete.ProjectPersistentCacheMessage>.Invoke (bool) [0x000a8] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at <StartupCode$FSharp-Core>.$Control/Post@2338.Invoke (Microsoft.FSharp.Core.Unit) [0x00001] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at <StartupCode$FSharp-Core>.$Control.loop@430-52 (Microsoft.FSharp.Control.Trampoline,Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00001] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at Microsoft.FSharp.Control.Trampoline.ExecuteAction (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00018] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at Microsoft.FSharp.Control.TrampolineHolder.Protect (Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Control.FakeUnitValue>) [0x00032] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at <StartupCode$FSharp-Core>.$Control/-ctor@516-1.Invoke (object) [0x00018] in <5584aad2904cf4daa7450383d2aa8455>:0
+  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (object) [0x00007] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <204f770036d441bb8dfd3daba3550e83>:0
+  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <204f770036d441bb8dfd3daba3550e83>:0
+  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) [0x0001e] in <204f770036d441bb8dfd3daba3550e83>:0
+/proc/self/maps:
+00400000-007a2000 r-xp 00000000 fd:10 102326903                          /usr/bin/mono-sgen
+009a1000-009a2000 r--p 003a1000 fd:10 102326903                          /usr/bin/mono-sgen
+009a2000-009a5000 rw-p 003a2000 fd:10 102326903                          /usr/bin/mono-sgen
+009a5000-009d9000 rw-p 00000000 00:00 0 
+022cc000-02a3a000 rw-p 00000000 00:00 0                                  [heap]
+40811000-40821000 rwxp 00000000 00:00 0 
+41dee000-41f22000 rwxp 00000000 00:00 0 
+7f5704000000-7f5704021000 rw-p 00000000 00:00 0 
+7f5704021000-7f5708000000 ---p 00000000 00:00 0 
+7f5708000000-7f5708068000 rw-p 00000000 00:00 0 
+7f5708068000-7f570c000000 ---p 00000000 00:00 0 
+7f570c000000-7f570c049000 rw-p 00000000 00:00 0 
+7f570c049000-7f5710000000 ---p 00000000 00:00 0 
+7f5710000000-7f5710050000 rw-p 00000000 00:00 0 
+7f5710050000-7f5714000000 ---p 00000000 00:00 0 
+7f5714000000-7f571416a000 rw-p 00000000 00:00 0 
+7f571416a000-7f5718000000 ---p 00000000 00:00 0 
+7f5718000000-7f571859c000 rw-p 00000000 00:00 0 
+7f571859c000-7f571c000000 ---p 00000000 00:00 0 
+7f571c000000-7f571c021000 rw-p 00000000 00:00 0 
+7f571c021000-7f5720000000 ---p 00000000 00:00 0 
+7f5721bab000-7f5721d9c000 r--p 00000000 fd:10 103466786                  /usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll
+7f5721d9c000-7f5721e1c000 rw-p 00000000 00:00 0 
+7f5721e1d000-7f5721f15000 r--p 00000000 fd:10 33746028                   /usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
+7f5721f15000-7f5721ff9000 r--p 00000000 fd:10 43237925                   /usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
+7f5721ff9000-7f5722002000 ---p 00000000 00:00 0 
+7f5722002000-7f57221fa000 rw-p 00000000 00:00 0 
+7f57221fa000-7f5722203000 ---p 00000000 00:00 0 
+7f5722203000-7f57223fb000 rw-p 00000000 00:00 0 
+7f57223fb000-7f5722404000 ---p 00000000 00:00 0 
+7f5722404000-7f57225fc000 rw-p 00000000 00:00 0 
+7f57225fc000-7f5722605000 ---p 00000000 00:00 0 
+7f5722605000-7f57227fd000 rw-p 00000000 00:00 0 
+7f57227fd000-7f5722806000 ---p 00000000 00:00 0 
+7f5722806000-7f57229fe000 rw-p 00000000 00:00 0 
+7f57229fe000-7f5722a07000 ---p 00000000 00:00 0 
+7f5722a07000-7f5722bff000 rw-p 00000000 00:00 0 
+7f5722bff000-7f5722c08000 ---p 00000000 00:00 0 
+7f5722c08000-7f5722f00000 rw-p 00000000 00:00 0 
+7f5722f56000-7f5723257000 r--p 00000000 fd:10 17944625                   /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
+7f5723257000-7f5724000000 r--p 00000000 fd:10 92335623                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/FSharp.Compiler.Service.dll
+7f5724000000-7f5724021000 rw-p 00000000 00:00 0 
+7f5724021000-7f5728000000 ---p 00000000 00:00 0 
+7f5728050000-7f5728051000 rw-p 00000000 00:00 0 
+7f5728051000-7f5728061000 rwxp 00000000 00:00 0 
+7f5728061000-7f572807d000 r--p 00000000 fd:10 67741469                   /usr/lib/mono/gac/System.Numerics/4.0.0.0__b77a5c561934e089/System.Numerics.dll
+7f572807d000-7f572811d000 r--p 00000000 fd:10 92335626                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/Newtonsoft.Json.dll
+7f572811d000-7f57281b8000 r--p 00000000 fd:10 92335632                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/FSharpLint.Core.dll
+7f57281b8000-7f5728457000 r--p 00000000 fd:10 119009772                  /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
+7f5728457000-7f5728543000 r--p 00000000 fd:10 92335622                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/FsAutoComplete.Core.dll
+7f5728543000-7f57286b3000 r--p 00000000 fd:10 92335629                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/FSharp.Core.dll
+7f57286b3000-7f57286bc000 ---p 00000000 00:00 0 
+7f57286bc000-7f57288b4000 rw-p 00000000 00:00 0 
+7f57288b4000-7f5728de2000 r-xp 00000000 fd:10 84017720                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
+7f5728de2000-7f5728fe1000 ---p 0052e000 fd:10 84017720                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
+7f5728fe1000-7f5728fe2000 rw-p 0052d000 fd:10 84017720                   /usr/lib/mono/aot-cache/amd64/mscorlib.dll.so
+7f5728fe2000-7f5729fff000 rw-p 00000000 00:00 0 
+7f5729fff000-7f572a000000 ---p 00000000 00:00 0 
+7f572a000000-7f572ac01000 rw-p 00000000 00:00 0 
+7f572ac01000-7f572ac03000 rw-p 00000000 00:00 0 
+7f572ac03000-7f572ac38000 r--p 00000000 fd:10 11019799                   /usr/lib/mono/gac/System.ServiceModel.Internals/0.0.0.0__b77a5c561934e089/System.ServiceModel.Internals.dll
+7f572ac38000-7f572ac3d000 r--p 00000000 fd:10 92335624                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/FSharp.Compiler.Service.ProjectCracker.dll
+7f572ac3d000-7f572ac4d000 rw-p 00000000 00:00 0 
+7f572ac4d000-7f572aff4000 r--p 00000000 fd:10 110466050                  /usr/lib/mono/4.5/mscorlib.dll
+7f572aff4000-7f572bc09000 r--p 00000000 fd:10 8482083                    /usr/lib/locale/locale-archive
+7f572bc09000-7f572bdc7000 r-xp 00000000 fd:10 41943561                   /lib/x86_64-linux-gnu/libc-2.19.so
+7f572bdc7000-7f572bfc7000 ---p 001be000 fd:10 41943561                   /lib/x86_64-linux-gnu/libc-2.19.so
+7f572bfc7000-7f572bfcb000 r--p 001be000 fd:10 41943561                   /lib/x86_64-linux-gnu/libc-2.19.so
+7f572bfcb000-7f572bfcd000 rw-p 001c2000 fd:10 41943561                   /lib/x86_64-linux-gnu/libc-2.19.so
+7f572bfcd000-7f572bfd2000 rw-p 00000000 00:00 0 
+7f572bfd2000-7f572bfe8000 r-xp 00000000 fd:10 41943585                   /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f572bfe8000-7f572c1e7000 ---p 00016000 fd:10 41943585                   /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f572c1e7000-7f572c1e8000 rw-p 00015000 fd:10 41943585                   /lib/x86_64-linux-gnu/libgcc_s.so.1
+7f572c1e8000-7f572c201000 r-xp 00000000 fd:10 41943651                   /lib/x86_64-linux-gnu/libpthread-2.19.so
+7f572c201000-7f572c400000 ---p 00019000 fd:10 41943651                   /lib/x86_64-linux-gnu/libpthread-2.19.so
+7f572c400000-7f572c401000 r--p 00018000 fd:10 41943651                   /lib/x86_64-linux-gnu/libpthread-2.19.so
+7f572c401000-7f572c402000 rw-p 00019000 fd:10 41943651                   /lib/x86_64-linux-gnu/libpthread-2.19.so
+7f572c402000-7f572c406000 rw-p 00000000 00:00 0 
+7f572c406000-7f572c409000 r-xp 00000000 fd:10 41943577                   /lib/x86_64-linux-gnu/libdl-2.19.so
+7f572c409000-7f572c608000 ---p 00003000 fd:10 41943577                   /lib/x86_64-linux-gnu/libdl-2.19.so
+7f572c608000-7f572c609000 r--p 00002000 fd:10 41943577                   /lib/x86_64-linux-gnu/libdl-2.19.so
+7f572c609000-7f572c60a000 rw-p 00003000 fd:10 41943577                   /lib/x86_64-linux-gnu/libdl-2.19.so
+7f572c60a000-7f572c611000 r-xp 00000000 fd:10 41943657                   /lib/x86_64-linux-gnu/librt-2.19.so
+7f572c611000-7f572c810000 ---p 00007000 fd:10 41943657                   /lib/x86_64-linux-gnu/librt-2.19.so
+7f572c810000-7f572c811000 r--p 00006000 fd:10 41943657                   /lib/x86_64-linux-gnu/librt-2.19.so
+7f572c811000-7f572c812000 rw-p 00007000 fd:10 41943657                   /lib/x86_64-linux-gnu/librt-2.19.so
+7f572c812000-7f572c917000 r-xp 00000000 fd:10 41943599                   /lib/x86_64-linux-gnu/libm-2.19.so
+7f572c917000-7f572cb16000 ---p 00105000 fd:10 41943599                   /lib/x86_64-linux-gnu/libm-2.19.so
+7f572cb16000-7f572cb17000 r--p 00104000 fd:10 41943599                   /lib/x86_64-linux-gnu/libm-2.19.so
+7f572cb17000-7f572cb18000 rw-p 00105000 fd:10 41943599                   /lib/x86_64-linux-gnu/libm-2.19.so
+7f572cb18000-7f572cb3b000 r-xp 00000000 fd:10 41943413                   /lib/x86_64-linux-gnu/ld-2.19.so
+7f572cb3b000-7f572cb49000 rw-p 00000000 00:00 0 
+7f572cb49000-7f572cb51000 r--p 00000000 fd:10 11019804                   /usr/lib/mono/gac/Microsoft.Build.Framework/12.0.0.0__b03f5f7f11d50a3a/Microsoft.Build.Framework.dll
+7f572cb51000-7f572cb9e000 r--p 00000000 fd:10 17944627                   /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
+7f572cb9e000-7f572cba0000 rw-p 00000000 00:00 0 
+7f572cba0000-7f572cbbe000 r--p 00000000 fd:10 84017698                   /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
+7f572cbbe000-7f572cbc4000 r--p 00000000 fd:10 92335625                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/NDesk.Options.dll
+7f572cbc4000-7f572cbdb000 r--p 00000000 fd:10 92335646                   /home/travis/build/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/fsautocomplete.exe
+7f572cbdb000-7f572ccc2000 rw-p 00000000 00:00 0 
+7f572ccc2000-7f572cd21000 ---p 00000000 00:00 0 
+7f572cd21000-7f572cd27000 rw-p 00000000 00:00 0 
+7f572cd27000-7f572cd37000 rw-p 00000000 00:00 0 
+7f572cd37000-7f572cd38000 rw-s 00000000 00:9d 49425749                   /dev/shm/mono.15509
+7f572cd38000-7f572cd3a000 rw-p 00000000 00:00 0 
+7f572cd3a000-7f572cd3b000 r--p 00022000 fd:10 41943413                   /lib/x86_64-linux-gnu/ld-2.19.so
+7f572cd3b000-7f572cd3c000 rw-p 00023000 fd:10 41943413                   /lib/x86_64-linux-gnu/ld-2.19.so
+7f572cd3c000-7f572cd3d000 rw-p 00000000 00:00 0 
+7fff6811a000-7fff68122000 ---p 00000000 00:00 0 
+7fff688f7000-7fff68919000 rw-p 00000000 00:00 0                          [stack]
+7fff689d5000-7fff689d7000 r--p 00000000 00:00 0                          [vvar]
+7fff689d7000-7fff689d9000 r-xp 00000000 00:00 0                          [vdso]
+ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
+null
+Native stacktrace:
+null
+	/usr/bin/mono-sgen() [0x4a9567]
+	/usr/bin/mono-sgen() [0x511316]
+	/usr/bin/mono-sgen(mono_method_signature_checked+0x33) [0x574bd3]
+	/usr/bin/mono-sgen() [0x564960]
+null
+Debug info from gdb:
+null
+mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb
+null
+=================================================================
+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.
+=================================================================
```


i can repro it rerunning the travis-ci job, if needed to install additional tools.

I'll try to minimize repro meanwhile
Comment 1 Ludovic Henry 2017-09-21 19:21:39 UTC
Could you please provide us with the native stacktrace of this bug, or even better a repro case? The only information in this stacktrace is that it crashed while calling `System.Delegate.CreateDelegate_internal`. Thank you.
Comment 2 Enrico Sada 2017-09-21 19:37:06 UTC
@ludovic how can i generate the native stacktrace?

this can be repro'ed by this repo branch https://github.com/fsharp/FsAutoComplete/pull/208

- cd fsharp/FsAutoComplete/test/FsAutoComplete.IntegrationTests/NoFSharpCoreReference
- fsharpi Runner.fsx

this invoke the program who crash (cannot isolate more because the script pass some input to command in the input stream).
Comment 3 Ludovic Henry 2017-09-22 20:05:39 UTC
To generate the stacktrace, you could run with the environment variable `MONO_DEBUG=suspend-on-sigsegv,disable_omit_fp`, attach with a debugger (lldb or gdb) when it crashes and dump all threads backtraces (`bt all` in lldb and `t a a bt` in gdb)

I tested on Ubuntu 14.04.1 32bits with Mono 5.2.0.224 and fsharp 3.0.34, but cannot reproduce the issue with the command provided in https://bugzilla.xamarin.com/show_bug.cgi?id=59255#c2.

Is there anything more I should do on top of the following commands?

> git clone --recursive https://github.com/fsharp/FsAutoComplete.git
> ... add `fetch = +refs/pull/*/head:refs/pull/origin/*` to .git/config
> git checkout -b pr-208 pull/origin/208
> ./build.sh
> cd test/FsAutoComplete.IntegrationTests/NoFSharpCoreReference/
> fsharpi Runner.fsx

Are you on ubuntu 14.04 32bits or 64bits?

Thank you

Note You need to log in before you can comment on or make changes to this bug.