Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Solved] Crash calling Physics:RaycastNonAlloc

Discussion in 'Physics' started by NachoAbril, Mar 6, 2017.

  1. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    We are having a crash in Editor when playing after calling RaycastNonAlloc. We cannot reproduce the exact point as it happens randomly inside our game. We are in Unity 5.5.1p2. Has anyone got this problem?

    This is the stack:
    ========== OUTPUTING STACK TRACE ==================

    0x00000001408FC6CB (Unity) CastFilter:: PreFilter
    0x0000000141E8D2FD (Unity) MultiQueryCallback<physx:: PxRaycastHit>::invoke
    0x0000000141E95575 (Unity) physx::Sq::BucketPruner::shiftOrigin
    0x0000000141E96982 (Unity) physx::Sq::BucketPruner::visualize
    0x0000000141E983F8 (Unity) physx::Sq::BucketPrunerCore::raycast
    0x0000000141E8F7C7 (Unity) physx::Sq::AABBPruner::raycast
    0x0000000141E8B6F4 (Unity) physx::NpSceneQueries::raycast
    0x00000001408FE0A6 (Unity) Unity:: PhysicsQuery::RaycastInternal
    0x0000000140901CDD (Unity) Unity:: PhysicsQuery::RaycastNonAlloc
    0x00000001409055FF (Unity) PhysicsManager::RaycastNonAlloc
    0x00000001415BC812 (Unity) Physics_CUSTOM_INTERNAL_CALL_RaycastNonAlloc
    0x000000006B5EDBC5 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Physics:INTERNAL_CALL_RaycastNonAlloc (UnityEngine.Vector3&,UnityEngine.Vector3&,UnityEngine.RaycastHit[],single,int,UnityEngine.QueryTriggerInteraction)
    0x000000006B5F3ABF (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\modules\Physics\DynamicsBindings.gen.cs:348] UnityEngine.Physics:RaycastNonAlloc (UnityEngine.Vector3,UnityEngine.Vector3,UnityEngine.RaycastHit[],single,int,UnityEngine.QueryTriggerInteraction)
    0x000000002C7711B2 (Mono JIT Code) [Z:\New_Raider\Development\Unity\Assets\Scripts\Core\RaycastManager.cs:289] RaycastManager:LateUpdate ()
    0x000000000B3769E2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x000007FEE94E54A3 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
    0x000007FEE94383F1 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
    0x0000000141204ADF (Unity) scripting_method_invoke
    0x0000000140E34865 (Unity) ScriptingInvocation::Invoke
    0x0000000141206E2E (Unity) MonoBehaviour::CallMethodIfAvailable
    0x000000014120A962 (Unity) MonoBehaviour::CallUpdateMethod
    0x000000014094BC5A (Unity) BaseBehaviourManager::CommonUpdate<LateBehaviourManager>
    0x000000014094BD2F (Unity) LateBehaviourManager::Update
    0x0000000140BC1427 (Unity) PlayerLoop
    0x0000000141487F22 (Unity) Application::UpdateScene
    0x00000001414894EF (Unity) Application::UpdateSceneIfNeeded
    0x0000000141491DB4 (Unity) Application::TickTimer
    0x000000014155380E (Unity) FindMonoBinaryToUse
    0x0000000141554E31 (Unity) WinMain
    0x000000014187049C (Unity) strnlen
    0x0000000076C559CD (kernel32) BaseThreadInitThunk
    0x0000000076D8A561 (ntdll) RtlUserThreadStart

    ========== END OF STACKTRACE ===========
     
  2. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    My bad. I was passing a NaN as distance to RaycastNonAlloc function