Skip to content

Segfault in libcoreclr.so #10856

@corruptmem

Description

@corruptmem

I'm experiencing a segmentation fault on .NET Core 2 on Linux/docker, under versions 2.1.2 and 2.0.9, when my process is under heavy load and using a lot of memory.

I haven't tried to reproduce outside of Linux/docker, but I have reproduced on both AWS Kubernetes and my local Docker for Windows with identical stack traces.

Here are some details from capturing the segfault under the debugger:

Process 1608 stopped
* thread dotnet/runtime#3876: tid = 1664, 0x00007fff821131b3, name = 'dotnet', stop reason = signal SIGSEGV: address access protected (fault address: 0x7ffd217b05c8)
    frame #0: 0x00007fff821131b3
->  0x7fff821131b3: rep
    0x7fff821131b4: movsq  (%rsi), %es:(%rdi)
    0x7fff821131b6: incl   0x8(%rbx)
    0x7fff821131b9: movl   $0x1, %eax

(lldb) clrstack
OS Thread Id: 0x680 (54)
        Child SP               IP Call Site
00007FFB5AFFA850 00007FFF821131B3 System.Collections.Generic.List`1+Enumerator[[System.ValueTuple`3[[System.DateTime, System.Private.CoreLib],[Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource, Ist.Terraform.TimeSeries],[System.Decimal, System.Private.CoreLib]], System.Private.CoreLib]].MoveNext() [/root/coreclr/src/mscorlib/shared/System/Collections/Generic/List.cs @ 1139]
00007FFB5AFFA870 00007FFF82112F6B System.Linq.Enumerable.Min[[System.ValueTuple`3[[System.DateTime, System.Private.CoreLib],[Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource, Ist.Terraform.TimeSeries],[System.Decimal, System.Private.CoreLib]], System.Private.CoreLib],[System.DateTime, System.Private.CoreLib]](System.Collections.Generic.IEnumerable`1<System.ValueTuple`3<System.DateTime,Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,System.Decimal>>, System.Func`2<System.ValueTuple`3<System.DateTime,Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,System.Decimal>,System.DateTime>) [/root/corefx-1818530/src/System.Linq/src/System/Linq/Min.cs @ 910]
00007FFB5AFFA990 00007FFF82112CE4 Ist.Terraform.TimeSeries.CompositeCalc.Portfolio.PortfolioBuyHoldReturnCalc+<>c__DisplayClass23_0.<.ctor>b__9(System.ValueTuple`3<System.DateTime,Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,System.Decimal>)
00007FFB5AFFA9D0 00007FFF82112B6A System.Linq.Enumerable+WhereListIterator`1[[System.ValueTuple`3[[System.DateTime, System.Private.CoreLib],[Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource, Ist.Terraform.TimeSeries],[System.Decimal, System.Private.CoreLib]], System.Private.CoreLib]].ToList() [/root/corefx-1818530/src/System.Linq/src/System/Linq/Where.cs @ 397]
00007FFB5AFFAAC0 00007FFF82100B35 Ist.Terraform.TimeSeries.CompositeCalc.Portfolio.PortfolioBuyHoldReturnCalc..ctor(Ist.Terraform.TimeSeries.Interfaces.ISeriesContainer, System.Collections.Generic.IDictionary`2<Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>>, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, System.Nullable`1<System.DateTime>, Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>, System.Nullable`1<Double>) [/app/src/Ist.Terraform.TimeSeries/CompositeCalc/Portfolio/PortfolioBuyHoldReturnCalc.cs @ 64]
00007FFB5AFFABD0 00007FFF820FF575 Ist.Terraform.TimeSeries.CompositeCalc.Portfolio.CalculatedCostReturnCalc..ctor(Ist.Terraform.TimeSeries.Interfaces.ISeriesContainer, System.Collections.Generic.IDictionary`2<Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>>, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, System.Nullable`1<System.DateTime>, System.Nullable`1<Double>) [/app/src/Ist.Terraform.TimeSeries/CompositeCalc/Portfolio/CalculatedCostReturnCalc.cs @ 24]
00007FFB5AFFAC50 00007FFF820FF419 Ist.Terraform.TimeSeries.TimeSeriesModuleFactory.CreatePortfolioModel(Int32, System.String, Ist.Terraform.Data.Models.Enums.CompositeType, System.Collections.Generic.IDictionary`2<Ist.Terraform.TimeSeries.CompositeCalc.CompositeSource,Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>>, Ist.Terraform.Data.Models.Enums.CurrencyCode, Ist.Terraform.Data.Models.Enums.CompositeCalcType, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, System.Collections.Generic.IList`1<Ist.Terraform.TimeSeries.CompositeCalc.CompositeRatio>, Ist.Terraform.Data.Models.Enums.RebalanceFrequency, System.Nullable`1<System.DateTime>, System.Nullable`1<Double>, Ist.Terraform.TimeSeries.Interfaces.ISeries`1<System.Nullable`1<Double>>) [/app/src/Ist.Terraform.TimeSeries/TimeSeriesModuleFactory.cs @ 261]
00007FFB5AFFAD20 00007FFF817F8544 Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<CreateSystemPortfolioAsync>d__25.MoveNext() [/app/src/Ist.Terraform.TimeSeries/TimeSeriesModuleFactory.cs @ 865]
00007FFB5AFFAE30 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFAE90 00007FFF817FFE71 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib],[Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<CreateSystemPortfolioAsync>d__25, Ist.Terraform.TimeSeries]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFAEC0 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFAF00 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFAFA0 00007FFF7CB9FD46 System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib]].TrySetResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 421]
00007FFB5AFFAFD0 00007FFF7CBDC60B System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].SetExistingTaskResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 639]
00007FFB5AFFB000 00007FFF818054AC Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<GetInvestableReturnsAsync>d__15.MoveNext()
00007FFB5AFFB080 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFB0E0 00007FFF820F6031 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib],[Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<GetInvestableReturnsAsync>d__15, Ist.Terraform.TimeSeries]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFB110 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFB150 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFB1F0 00007FFF7CB9FD46 System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib]].TrySetResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 421]
00007FFB5AFFB220 00007FFF7CBDC60B System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].SetExistingTaskResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 639]
00007FFB5AFFB250 00007FFF81806CB4 Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<GetPricesAsync>d__30.MoveNext()
00007FFB5AFFB360 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFB3C0 00007FFF818097F1 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib],[Ist.Terraform.TimeSeries.TimeSeriesModuleFactory+<GetPricesAsync>d__30, Ist.Terraform.TimeSeries]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFB3F0 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFB430 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFB4D0 00007FFF7CB9FD46 System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib]].TrySetResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 421]
00007FFB5AFFB500 00007FFF7CBDC60B System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].SetExistingTaskResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 639]
00007FFB5AFFB530 00007FFF8180BEFA Ist.Terraform.Data.Repositories.PostgresRepository+<GetSeriesPricesAsync>d__24.MoveNext()
00007FFB5AFFBCB0 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFBD10 00007FFF81819751 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib],[Ist.Terraform.Data.Repositories.PostgresRepository+<GetSeriesPricesAsync>d__24, Ist.Terraform.Data]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFBD40 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFBD80 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFBE20 00007FFF7CBD641C System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].TrySetResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 424]
00007FFB5AFFBE50 00007FFF7CBA93BF System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetExistingTaskResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 646]
00007FFB5AFFBE70 00007FFF8181BFA0 Npgsql.NpgsqlTransaction+<Commit>d__17.MoveNext()
00007FFB5AFFBEC0 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFBF20 00007FFF80B0D6C0 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Npgsql.NpgsqlTransaction+<Commit>d__17, Npgsql]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFBF50 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFBF90 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFC030 00007FFF7CBD641C System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].TrySetResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 424]
00007FFB5AFFC060 00007FFF7CBA93BF System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetExistingTaskResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 646]
00007FFB5AFFC080 00007FFF8181CBA4 Npgsql.NpgsqlConnector+<ExecuteInternalCommand>d__204.MoveNext()
00007FFB5AFFC1B0 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFC210 00007FFF80381090 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Npgsql.NpgsqlConnector+<ExecuteInternalCommand>d__204, Npgsql]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFC240 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFC280 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFC320 00007FFF7CB9FD46 System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib]].TrySetResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 421]
00007FFB5AFFC350 00007FFF7CBDC60B System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib]].SetExistingTaskResult(System.__Canon) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 639]
00007FFB5AFFC380 00007FFF80AF9131 Npgsql.NpgsqlConnector+<>c__DisplayClass161_0+<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
00007FFB5AFFC470 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFC4D0 00007FFF80AFD161 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib],[Npgsql.NpgsqlConnector+<>c__DisplayClass161_0+<<ReadMessage>g__ReadMessageLong|0>d, Npgsql]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFC500 00007FFF7CB9A637 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs @ 798]
00007FFB5AFFC540 00007FFF7CB5098E System.Threading.Tasks.Task.RunContinuations(System.Object) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs @ 3275]
00007FFB5AFFC5E0 00007FFF7CBD641C System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].TrySetResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs @ 424]
00007FFB5AFFC610 00007FFF7CBA93BF System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetExistingTaskResult(System.Threading.Tasks.VoidTaskResult) [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 646]
00007FFB5AFFC630 00007FFF80AF9D95 Npgsql.NpgsqlReadBuffer+<>c__DisplayClass31_0+<<Ensure>g__EnsureLong|0>d.MoveNext()
00007FFB5AFFC6C0 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFC720 00007FFF80AFCB70 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Npgsql.NpgsqlReadBuffer+<>c__DisplayClass31_0+<<Ensure>g__EnsureLong|0>d, Npgsql]].MoveNext() [/root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @ 568]
00007FFB5AFFC750 00007FFF7FB06D73 System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs @ 219]
00007FFB5AFFC770 00007FFF7FB075F0 System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(System.Object) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs @ 439]
00007FFB5AFFC780 00007FFF7CB0CF9D System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [/root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs @ 167]
00007FFB5AFFC7E0 00007FFF7FB08169 System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncSuccess(Int32, System.Net.Sockets.SocketFlags) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs @ 786]
00007FFB5AFFC800 00007FFF7FB095A4 System.Net.Sockets.SocketAsyncEventArgs.CompletionCallback(Int32, System.Net.Sockets.SocketFlags, System.Net.Sockets.SocketError) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs @ 413]
00007FFB5AFFC820 00007FFF7FB08686 System.Net.Sockets.SocketAsyncEventArgs.TransferCompletionCallbackCore(Int32, Byte[], Int32, System.Net.Sockets.SocketFlags, System.Net.Sockets.SocketError) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs @ 122]
00007FFB5AFFC830 00007FFF7FB15202 System.Net.Sockets.SocketAsyncContext+BufferMemoryReceiveOperation.InvokeCallback(Boolean) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs @ 464]
00007FFB5AFFC880 00007FFF7FB15D1B System.Net.Sockets.SocketAsyncContext+OperationQueue`1[[System.__Canon, System.Private.CoreLib]].ProcessAsyncOperation(System.__Canon) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs @ 855]
00007FFB5AFFC8B0 00007FFF7FB16318 System.Net.Sockets.SocketAsyncContext+OperationQueue`1+<>c[[System.__Canon, System.Private.CoreLib]].<.cctor>b__18_0(System.Object) [/root/corefx-1818530/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs @ 697]
00007FFB5AFFC8C0 00007FFF7CB9C6E8 System.Threading.ThreadPoolWorkQueue.Dispatch() [/root/coreclr/src/mscorlib/src/System/Threading/ThreadPool.cs @ 588]
00007FFB5AFFCC90 00007ffff6269ecf [DebuggerU2MCatchHandlerFrame: 00007ffb5affcc90]

(lldb) bt
* thread dotnet/runtime#3876: tid = 1664, 0x00007fff821131b3, name = 'dotnet', stop reason = signal SIGSEGV: address access protected (fault address: 0x7ffd217b05c8)
  * frame #0: 0x00007fff821131b3
    frame dotnet/coreclr#1: 0x00007fff82112f6b
    frame dotnet/coreclr#2: 0x00007fff82112ce4
    frame dotnet/coreclr#3: 0x00007fff82112b6a
    frame dotnet/coreclr#4: 0x00007fff82100b35
    frame dotnet/coreclr#5: 0x00007fff820ff575
    frame dotnet/coreclr#6: 0x00007fff820ff419
    frame dotnet/coreclr#7: 0x00007fff817f8544
    frame dotnet/coreclr#8: 0x00007fff7cb0cf9d
    frame dotnet/coreclr#9: 0x00007fff817ffe71
    frame dotnet/coreclr#10: 0x00007fff7cb9a637
    frame dotnet/coreclr#11: 0x00007fff7cb5098e
    frame dotnet/coreclr#12: 0x00007fff7cb9fd46
    frame dotnet/coreclr#13: 0x00007fff7cbdc60b
    frame dotnet/coreclr#14: 0x00007fff818054ac
    frame dotnet/coreclr#15: 0x00007fff7cb0cf9d
    frame dotnet/coreclr#16: 0x00007fff820f6031
    frame dotnet/coreclr#17: 0x00007fff7cb9a637
    frame dotnet/coreclr#18: 0x00007fff7cb5098e
    frame dotnet/coreclr#19: 0x00007fff7cb9fd46
    frame dotnet/coreclr#20: 0x00007fff7cbdc60b
    frame dotnet/coreclr#21: 0x00007fff81806cb4
    frame dotnet/coreclr#22: 0x00007fff7cb0cf9d
    frame dotnet/coreclr#23: 0x00007fff818097f1
    frame dotnet/coreclr#24: 0x00007fff7cb9a637
    frame dotnet/runtime#3858: 0x00007fff7cb5098e
    frame dotnet/runtime#3859: 0x00007fff7cb9fd46
    frame dotnet/coreclr#27: 0x00007fff7cbdc60b
    frame dotnet/runtime#3860: 0x00007fff8180befa
    frame dotnet/runtime#3861: 0x00007fff7cb0cf9d
    frame dotnet/runtime#3862: 0x00007fff81819751
    frame dotnet/runtime#3863: 0x00007fff7cb9a637
    frame dotnet/coreclr#32: 0x00007fff7cb5098e
    frame dotnet/runtime#3864: 0x00007fff7cbd641c
    frame dotnet/runtime#3865: 0x00007fff7cba93bf
    frame dotnet/coreclr#35: 0x00007fff8181bfa0
    frame dotnet/coreclr#36: 0x00007fff7cb0cf9d
    frame dotnet/runtime#3866: 0x00007fff80b0d6c0
    frame dotnet/coreclr#38: 0x00007fff7cb9a637
    frame dotnet/runtime#3867: 0x00007fff7cb5098e
    frame dotnet/runtime#3868: 0x00007fff7cbd641c
    frame dotnet/coreclr#41: 0x00007fff7cba93bf
    frame dotnet/coreclr#42: 0x00007fff8181cba4
    frame dotnet/runtime#3869: 0x00007fff7cb0cf9d
    frame dotnet/runtime#3870: 0x00007fff80381090
    frame dotnet/runtime#3871: 0x00007fff7cb9a637
    frame dotnet/coreclr#46: 0x00007fff7cb5098e
    frame dotnet/runtime#3872: 0x00007fff7cb9fd46
    frame dotnet/coreclr#48: 0x00007fff7cbdc60b
    frame dotnet/runtime#3873: 0x00007fff80af9131
    frame dotnet/coreclr#50: 0x00007fff7cb0cf9d
    frame dotnet/runtime#3874: 0x00007fff80afd161
    frame dotnet/runtime#3875: 0x00007fff7cb9a637
    frame dotnet/coreclr#53: 0x00007fff7cb5098e
    frame dotnet/runtime#3876: 0x00007fff7cbd641c
    frame dotnet/runtime#3877: 0x00007fff7cba93bf
    frame dotnet/coreclr#56: 0x00007fff80af9d95
    frame dotnet/runtime#3878: 0x00007fff7cb0cf9d
    frame dotnet/coreclr#58: 0x00007fff80afcb70
    frame dotnet/runtime#3879: 0x00007fff7fb06d73
    frame dotnet/runtime#3880: 0x00007fff7cb0cf9d
    frame dotnet/runtime#3881: 0x00007fff7fb08169
    frame dotnet/coreclr#62: 0x00007fff7fb095a4
    frame dotnet/coreclr#63: 0x00007fff7fb08686
    frame dotnet/coreclr#64: 0x00007fff7fb15d1b
    frame dotnet/runtime#3882: 0x00007fff7fb16318
    frame dotnet/coreclr#66: 0x00007ffff6269ecf libcoreclr.so`CallDescrWorkerInternal + 124
    frame dotnet/coreclr#67: 0x00007ffff618a5fc libcoreclr.so`MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 83 at callhelpers.cpp:78
    frame dotnet/runtime#3883: 0x00007ffff618a5a9 libcoreclr.so`MethodDescCallSite::CallTargetWorker(this=<unavailable>, pArguments=<unavailable>, pReturnValue=0x00007ffb5affcb28, cbReturnValue=8) + 857 at callhelpers.cpp:620
    frame dotnet/coreclr#69: 0x00007ffff630a845 libcoreclr.so`QueueUserWorkItemManagedCallback(void*) [inlined] MethodDescCallSite::Call_RetBool(this=0x00007ffb5affcb30, pArguments=<unavailable>) + 15 at callhelpers.h:433
    frame dotnet/runtime#3884: 0x00007ffff630a836 libcoreclr.so`QueueUserWorkItemManagedCallback(pArg=0x00007ffb5affcebe) + 166 at comthreadpool.cpp:451
    frame dotnet/coreclr#71: 0x00007ffff615bf2d libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) [inlined] ManagedThreadBase_DispatchInner(pCallState=0x00007ffb5affcd68) + 413 at threads.cpp:8850
    frame dotnet/runtime#3885: 0x00007ffff615bedb libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) [inlined] ManagedThreadBase_DispatchMiddle(pCallState=0x00007ffb5affcd68) + 83 at threads.cpp:8901
    frame dotnet/runtime#3886: 0x00007ffff615be88 libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) [inlined] ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::$_8::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const::{lambda(Param*)#1}::operator()(Param*) const at threads.cpp:9139
    frame dotnet/runtime#3887: 0x00007ffff615be88 libcoreclr.so`ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) at threads.cpp:9141
    frame dotnet/coreclr#75: 0x00007ffff615be88 libcoreclr.so`ManagedThreadBase_DispatchOuter(pCallState=<unavailable>) + 248 at threads.cpp:9178
    frame dotnet/runtime#3888: 0x00007ffff615c690 libcoreclr.so`ManagedThreadBase::ThreadPool(ADID, void (*)(void*), void*) [inlined] ManagedThreadBase_FullTransitionWithAD(pAppDomain=<unavailable>, pTarget=<unavailable>, args=<unavailable>, filterType=ThreadPoolThread)(void*), void*, UnhandledExceptionLocation) + 43 at threads.cpp:9199
    frame dotnet/runtime#3889: 0x00007ffff615c665 libcoreclr.so`ManagedThreadBase::ThreadPool(pAppDomain=<unavailable>, pTarget=<unavailable>, args=<unavailable>)(void*), void*) + 21 at threads.cpp:9241
    frame dotnet/runtime#3890: 0x00007ffff62eea47 libcoreclr.so`ManagedPerAppDomainTPCount::DispatchWorkItem(this=0x00000000006952a0, foundWork=0x00007ffb5affcebf, wasNotRecalled=0x00007ffb5affcebe) + 295 at threadpoolrequest.cpp:754
    frame dotnet/runtime#3891: 0x00007ffff617ad23 libcoreclr.so`ThreadpoolMgr::WorkerThreadStart(void*) [inlined] ThreadpoolMgr::ExecuteWorkRequest(bool*, bool*) + 1267 at win32threadpool.cpp:1560
    frame dotnet/coreclr#80: 0x00007ffff617ad02 libcoreclr.so`ThreadpoolMgr::WorkerThreadStart(lpArgs=<unavailable>) + 1234 at win32threadpool.cpp:2024
    frame dotnet/coreclr#81: 0x00007ffff64f0f72 libcoreclr.so`CorUnix::CPalThread::ThreadEntry(pvParam=0x00007ffb74003b80) + 306 at thread.cpp:1682
    frame dotnet/coreclr#82: 0x00007ffff79bf494 libpthread.so.0`start_thread + 196
    frame dotnet/runtime#3892: 0x00007ffff6e64acf libc.so.6`clone + 63

(lldb) sos VerifyHeap
Object 00007ffb01dd4ff8 has an invalid method table.
Last good object: 00007FFB01DD4FD8.
Object 00007ffe12430570 has an invalid method table.
Last good object: 00007FFE12430358.
Object 00007fff4ffff000 has an invalid method table.Object 00007ffae914b000 has an invalid method table.Object 00007ffa9593b000 has an invalid method table.Object 00007ffe8ffff000 has an invalid method table.Object 00007fff5ffff000 has an invalid method table.Object 00007ffad9149000 has an invalid method table.Object 00007ffaa593d000 has an invalid method table.Failed to request SyncBlk at index 1.
VerifyHeap  failed

I don't have the coredump from this particular crash (because it got OOM killed after calling VerifyHeap!), but most times it crashes, the top of the stack is identical to this (see attached file 4 for one of the times it didn't look like this).

Unfortunately I can't post the code because it's proprietary. We're working on trying to produce a minimal test case, but that's a lot easier said than done. However if you have somewhere secure and private to upload core dumps to, I could do that.

I have also attached information from the debugger from other crashes (the one above is file 3):

dumpinfo1.txt
dumpinfo2.txt
dumpinfo3.txt
dumpinfo4.txt

The environment I set up to reproduce the issue is here: https://github.com/ist-ltd/dotnet-core-debug-helper-tools - but it relies on a private docker image.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions