Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread Safety? #36

Closed
Neo-vortex opened this issue Dec 8, 2023 · 1 comment
Closed

Thread Safety? #36

Neo-vortex opened this issue Dec 8, 2023 · 1 comment

Comments

@Neo-vortex
Copy link

can secp256k1.PublicKeyCreate be called by multiple thread ?

it fails with :

Process terminated. Encountered infinite recursion while looking up resource 'Exception_EndOfInnerExceptionStack' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.Exception.ToString()
   at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
   at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
   at Secp256k1Net.Secp256k1.PublicKeyCreate(System.Span`1<Byte>, System.Span`1<Byte>)
   at Program+<>c__DisplayClass0_0.<<Main>$>g__GetPublicKeyFromPrivateKey|4(System.String)
   at Program+<>c__DisplayClass0_0.<<Main>$>g__PrivateToAddress|2(System.String)
   at Program+<>c__DisplayClass0_0.<<Main>$>b__1(Int32, System.Threading.Tasks.ParallelLoopState)
   at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int64, Boolean ByRef)
   at System.Threading.Tasks.TaskReplicator+Replica.Execute()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()

@zone117x
Copy link
Owner

zone117x commented Dec 8, 2023

Dupe of this issue #33

Feel free to open a PR!

@zone117x zone117x closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants