Open palerzhang opened 4 years ago
This could happen if some nan values went into the simulation or there could be an object falling to infinity maybe? Have you please tried to run CHECKED configuration, it does include NAN checks for the input functions.
This could happen if some nan values went into the simulation or there could be an object falling to infinity maybe? Have you please tried to run CHECKED configuration, it does include NAN checks for the input functions.
Thanks for your reply. Unfortunately, it is non-reproducible and it happened rarely among our customers. But I will try the way that you proposed.
By the way, I re-checked the codes of physx::Sq::DynamicBoundsSync::sync that we used and found that we used a much lower version of PhysX 3.4. So I upgrade the version of codes to see if this happens again among our customers.
This could happen if some nan values went into the simulation or there could be an object falling to infinity maybe? Have you please tried to run CHECKED configuration, it does include NAN checks for the input functions.
Unfortunately, we are unable to upgrade the PhysX version yet for some reasons. But luckily I found the file PsUnixNeonInlineAoS.h and the code at the top of call stack. The crash occurred when loading floats with neon interface vld1q_f32
(first V4LoadU in function inflateBounds
in SqBounds.h).
PX_FORCE_INLINE void inflateBounds(PxBounds3& dst, const PxBounds3& src)
{
using namespace physx::shdfnd::aos;
const Vec4V minV = V4LoadU(&src.minimum.x);
const Vec4V maxV = V4LoadU(&src.maximum.x);
const Vec4V eV = V4Scale(V4Sub(maxV, minV), FLoad(0.5f * 0.01f));
V4StoreU(V4Sub(minV, eV), &dst.minimum.x);
PX_ALIGN(16, PxVec4) max4;
V4StoreA(V4Add(maxV, eV), &max4.x);
dst.maximum = PxVec3(max4.x, max4.y, max4.z);
}
As the crash reason is SIGSEGV, I wonder if there's invalid address was accessed. However, it seems that &src.minimum.x
is a valid address. So I go back to find where the parameter src
comes from. In ScScene.cpp:
void Sc::Scene::syncSceneQueryBounds(SqBoundsSync& sync, SqRefFinder& finder)
{
mSqBoundsManager->syncBounds(sync, finder, mBoundsArray->begin(), getContextId());
}
It comes from mBoundsArray
with an index. mBoundsArray->begin()
will return the internal data array, but the array will be NULL
if there's no elements and no empty-check is performed when using it. I'm wondering if this is the reason that cause the crash. Maybe my guessing is wrong as I do not read the whole codes and there may be some strategy to preventing mBoundsArray->begin()
to be NULL
witch I missed.
I got a crash inside NpScene::fetchResults on Android. The call stack is
The Android SDK level is 28 and the OS is Android 9.0. The last call (line 0) is in file PsUnixNeonInlineAoS.h but I can not find this file in PhysX 3.4 sources. It seems like a really rare kind of crash as I can not find anything useful from Internet.