ArgumentOutOfRangeException or InvalidCastException in JsonRpcSharp.TcpClient (non-legacy) when debugging on real android phone (Sony Xperia)
Created by: Andres G. Aragoneses
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: start
at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument) [0x00006] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.ReadOnlyMemory`1[T].Slice (System.Int32 start, System.Int32 length) [0x0001e] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.Buffers.ReadOnlySequence`1[T].GetFirstBuffer () [0x00065] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.Buffers.ReadOnlySequence`1[T].get_First () [0x00000] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.Buffers.BuffersExtensions.PositionOf[T] (System.Buffers.ReadOnlySequence`1[T]& source, T value) [0x00008] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at GWallet.Backend.JsonRpcSharp+keepAdvancingPosition@56.Invoke (System.Buffers.ReadOnlySequence`1[T] buffer) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/JsonRpcSharp.fs:57
at GWallet.Backend.JsonRpcSharp+clo@54-2.Invoke (System.IO.Pipelines.ReadResult _arg1) [0x00014] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/JsonRpcSharp.fs:63
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+continuation@974-1[T].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000ad] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncResult`1[T].Commit () [0x0002c] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at <StartupCode$FSharp-Core>.$Async+AwaitAndBindChildResult@1484-3[T].Invoke (System.Boolean _arg3) [0x0000f] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at <StartupCode$FSharp-Core>.$Async+AwaitWaitHandle@1426-4.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@126-60[E,T,R].Invoke (System.Exception _arg2) [0x000dd] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/FaultTolerantParallelClient.fs:132
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@126-66[E,T,R].Invoke (System.Exception exn) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/FaultTolerantParallelClient.fs:126
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@126-68[E,T,R].Invoke (System.Exception edi) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/FaultTolerantParallelClient.fs:126
at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] catchFilter, System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0000c] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+TryWith@526[T].Invoke (System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0002a] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at <StartupCode$FSharp-Core>.$Async+Execute@128.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0
at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x0002b] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0
at System.Threading.Tasks.Task`1[TResult].get_Result () [0x0000f] in <4d6eb5dfe2ab4eee884ef920069afd5f>:0
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@73-51[E,R,T].Invoke (System.Threading.Tasks.Task`1[TResult] _arg1) [0x00002] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/FaultTolerantParallelClient.fs:73
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+Bind@495-1[TResult,T].Invoke (TResult result1) [0x00000] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+continuation@974-1[T].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000ad] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/FSharpUtil.fs:20
at GWallet.Backend.Account+GetBalanceFromServer@27-5.Invoke (System.Exception _arg2) [0x00028] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/Account.fs:35
at GWallet.Backend.Account+GetBalanceFromServer@27-8.Invoke (System.Exception exn) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/Account.fs:27
at GWallet.Backend.Account+GetBalanceFromServer@27-10.Invoke (System.Exception edi) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTEND/src/GWallet.Backend/Account.fs:27
at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] catchFilter, System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0000c] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+TryWith@526[T].Invoke (System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0002a] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at <StartupCode$FSharp-Core>.$Async+Execute@128.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5b5a6dc5904cf4daa7450383c56d5a5b>:0
--- End of inner exception stack trace ---
Imported comments:
By Andres G. Aragoneses on 2018-12-28T06:07:17.105Z
Relevant: https://github.com/dotnet/corefx/issues/32711#issuecomment-431266904
By Andres G. Aragoneses on 2018-12-28T06:05:17.935Z
Today I got:
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.InvalidCastException: Specified cast is not valid.
at System.Buffers.ReadOnlySequence`1[T].GetFirstBuffer () [0x00079] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.Buffers.ReadOnlySequence`1[T].get_First () [0x00000] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at System.Buffers.BuffersExtensions.PositionOf[T] (System.Buffers.ReadOnlySequence`1[T]& source, T value) [0x00008] in <f6dad3dbe4c6408e8a0f6ade27956b1c>:0
at GWallet.Backend.JsonRpcSharp+keepAdvancingPosition@54.Invoke (System.Buffers.ReadOnlySequence`1[T] buffer) [0x00002] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/JsonRpcSharp.fs:57
at GWallet.Backend.JsonRpcSharp+clo@70-2.Invoke (System.IO.Pipelines.ReadResult _arg1) [0x00002] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/JsonRpcSharp.fs:70
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+continuation@974-1[T].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000a3] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncResult`1[T].Commit () [0x0002c] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$FSharp-Core>.$Async+AwaitAndBindChildResult@1484-3[T].Invoke (System.Boolean _arg3) [0x0000f] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$FSharp-Core>.$Async+AwaitWaitHandle@1426-4.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncResult`1[T].Commit () [0x0002c] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronouslyInCurrentThread[a] (System.Threading.CancellationToken cancellationToken, Microsoft.FSharp.Control.FSharpAsync`1[T] computation) [0x00028] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T] (System.Threading.CancellationToken cancellationToken, Microsoft.FSharp.Control.FSharpAsync`1[T] computation, Microsoft.FSharp.Core.FSharpOption`1[T] timeout) [0x00013] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T] (Microsoft.FSharp.Control.FSharpAsync`1[T] computation, Microsoft.FSharp.Core.FSharpOption`1[T] timeout, Microsoft.FSharp.Core.FSharpOption`1[T] cancellationToken) [0x0006e] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at GWallet.Backend.UtxoCoin.Account+ElectrumServerToRetreivalFunc@70[T,R].Invoke (GWallet.Backend.UtxoCoin.ElectrumServer electrumServer, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] electrumClientFunc, T arg) [0x000fd] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/UtxoCoin/UtxoCoinAccount.fs:89
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@2823-1[T2,T3,TResult,T1].Invoke (T2 u, T3 v) [0x00000] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Core.OptimizedClosures+Invoke@2810[T2,TResult,T1].Invoke (T2 u) [0x00000] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@136-60[E,K,T,R].Invoke (Microsoft.FSharp.Core.Unit unitVar) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:136
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, TResult result1, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] part2) [0x00005] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives.TryWith[T] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Control.FSharpAsync`1[T] computation, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] catchFunction) [0x00034] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@135-70[E,K,T,R].Invoke (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:135
at Microsoft.FSharp.Control.AsyncPrimitives.Invoke[T] (Microsoft.FSharp.Control.FSharpAsync`1[T] computation, Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt) [0x0005f] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+QueueAsync@855[a].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00038] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FSharpUtil.fs:35
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@135-62[E,K,T,R].Invoke (System.Exception _arg2) [0x000e5] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:156
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@135-69[E,K,T,R].Invoke (System.Exception exn) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:135
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@135-71[E,K,T,R].Invoke (System.Exception edi) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:135
at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] catchFilter, System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0000c] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$FSharp-Core>.$Async+Execute@128.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x0002b] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at System.Threading.Tasks.Task`1[TResult].get_Result () [0x0000f] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at <StartupCode$GWallet-Backend-NetStandard>.$FaultTolerantParallelClient+clo@78-53[E,K,R,T].Invoke (System.Threading.Tasks.Task`1[TResult] _arg1) [0x00002] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FaultTolerantParallelClient.fs:78
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] userCode, b result1) [0x00005] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.AsyncPrimitives+continuation@974-1[T].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x000a3] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/FSharpUtil.fs:35
at GWallet.Backend.Account+GetBalanceFromServer@28-5.Invoke (System.Exception _arg2) [0x00028] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/Account.fs:36
at GWallet.Backend.Account+GetBalanceFromServer@28-8.Invoke (System.Exception exn) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/Account.fs:28
at GWallet.Backend.Account+GetBalanceFromServer@28-10.Invoke (System.Exception edi) [0x00000] in /Users/andres/Documents/Code/gwalletFRONTENDCLEAN/src/GWallet.Backend/Account.fs:28
at Microsoft.FSharp.Control.AsyncPrimitives.CallFilterThenInvoke[T] (Microsoft.FSharp.Control.AsyncActivation`1[T] ctxt, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] catchFilter, System.Runtime.ExceptionServices.ExceptionDispatchInfo edi) [0x0000c] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at <StartupCode$FSharp-Core>.$Async+Execute@128.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <5beb52bf904cf4daa7450383bf52eb5b>:0
at Microsoft.FSharp.Control.Trampoline.Execute (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] firstAction) [0x00020] in <5beb52bf904cf4daa7450383bf52eb5b>:0
--- End of inner exception stack trace ---
And removing the use of Option.ofNullable didn't work, so it's definitely inside PositionOf()
By Andres G. Aragoneses on 2018-12-28T06:03:55.827Z
changed the description
By Andres G. Aragoneses on 2018-12-28T06:03:55.806Z
changed title from ArgumentOutOfRangeException in JsonRpcSharp.TcpClient (non-legacy) when debugging on real android phone (Sony Xperia) to ArgumentOutOfRangeException or InvalidCastException in JsonRpcSharp.TcpClient (non-legacy) when debugging on real android phone (Sony Xperia)
By Andres G. Aragoneses on 2018-10-08T17:18:56.416Z
mentioned in commit 5a3f51b9