-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Crash when using c# bindings #130
Comments
The bindings are setting SIMD Level 0 by default, when changing it to something like e.g. 1 << 8 (AVX2) the crash disappears. public static FastNoise FromEncodedNodeTree(string encodedNodeTree)
|
I think this is caused by a threading race condition when detecting the SIMD level. As a workaround you can call |
That seemed to work, thanks! |
Sadly it's still crashing, just happening less :/ |
Hi,
I'm using the library with the c# bindings inside unity and get crashes from time to time.
Here are the stacktraces:
========== OUTPUTTING STACK TRACE ==================
0x00007FFC6A31A269 (FastNoise) FastSIMD::ClassFactoryFastNoise::White,4
0x00007FFC6A32C21C (FastNoise) FastSIMD::ClassFactoryFastNoise::White,4
0x00007FFC6A2E5AAF (FastNoise) fnGenUniformGrid2D
0x000002447C334E0C (Mono JIT Code) (wrapper managed-to-native) FastNoise:fnGenUniformGrid2D (intptr,single[],int,int,int,int,single,int,single[])
0x000002447C334643 (Mono JIT Code) [J:\Unity\Nyrn\Assets\Code\Third-Party\FastNoise2.cs:177] FastNoise:GenUniformGrid2D (single[],int,int,int,int,single,int)
0x000002447C328EAB (Mono JIT Code) [J:\Unity\Nyrn\Assets\Code\WorldGeneration\TileTerrainJob.cs:86] Nyrn.WorldGeneration.TileTerrainJob:Nyrn.WorldGeneration.IGenerationJob.Execute (object)
0x00000242D903E0AA (Mono JIT Code) System.Threading.QueueUserWorkItemCallback:WaitCallback_Context (object)
0x00000242C91CA0BE (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000242C91C969B (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000242D903DED3 (Mono JIT Code) System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
0x00000242D9039039 (Mono JIT Code) System.Threading.ThreadPoolWorkQueue:Dispatch ()
0x00000242D9037DF3 (Mono JIT Code) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
0x00000242D9038365 (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_bool (object,intptr,intptr,intptr)
0x00007FFC22FD4B7E (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\mini\mini-runtime.c:3445] mono_jit_runtime_invoke
0x00007FFC22F0D204 (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\object.c:3068] do_runtime_invoke
0x00007FFC22F4E9AD (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threadpool.c:386] worker_callback
0x00007FFC22F51C13 (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threadpool-worker-default.c:502] worker_thread
0x00007FFC22F3F98B (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threads.c:1272] start_wrapper_internal
0x00007FFC22F3FB9E (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threads.c:1348] start_wrapper
0x00007FFCA0D97344 (KERNEL32) BaseThreadInitThunk
0x00007FFCA13A26B1 (ntdll) RtlUserThreadStart
========== END OF STACKTRACE ===========
=================================================================
Managed Stacktrace:
=================================================================
The text was updated successfully, but these errors were encountered: