-
Notifications
You must be signed in to change notification settings - Fork 800
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 in PxsNphaseImplementationContext::unregisterContactManager method. #48
Comments
Thanks for reporting. Are you using a debug configuration? We're there any errors logged before this? Are you able to reproduce the issue and would you be able to provide either a repro or repro steps? Thanks Kier |
I'm using Debug and Checked 'win.x86_64.vc140.mt' configurations and the code crashes in both. I'll try to create demo project to repro this issue. |
Thanks |
I also get this same exact crash, but it happens very rarely and I haven't been able to reproduce it. I'm running a checked config of "PhysX 3.4.1, APEX 1.4.1 Release @2284554". I recently switched to latest 3.4, and I haven't seen any of these crashes yet, but like I said it's a rare crash. I log all the errors and I've often (but not always) seen this happen after many repeated errors with the text: "Number of required 16k memory blocks has exceeded the initial number of blocks. Allocator is being called. Consider increasing the number of pre-allocated 16k blocks.". |
...and I just now got a crash report from a build running the latest 3.4. |
If you can provide a repro - even one that intermittently happens, we will investigate and fix it. Ideally, it would be an isolated repro, but we have previously taken entire games and grinded with them for days to get to the bottom of intermittent issues like this. |
Hi, I was trying to reproduce this crash using PhysX Sample framework and found another issue. The PhysX will crash at:
Steps to reproduce:
|
Thanks for the repro. I've tracked this down and have a fix for the repro you provided. It is due to a mismatch in the bounds computed in CCD and in discrete broad phase, which results in CCD broad phase being incorrectly entered when there are no shapes that updated. There was an optimization added to bounds computation (to make tighter bounds), which was controlled with a flag in 3.4 but turned on by default in 4.0. This optimization was not present in the CCD bounds. As the bounds are used to control whether CCD is required, this mismatch incorrectly triggered CCD for some resting convex shapes, which resulted in a nullptr being dereferenced. The fix for that crash (and also small optimization) is to modify the Gu::computeBoundsWithCCDThreshold in GuBounds.cpp to match this: `// PT: TODO: refactor this with regular function
}` This ensures that the same bounds are used for both CCD and discrete BP so, in the resting case, the BP is never invoked. I will make sure that this appears in our next code drop. I expect that this is unrelated to the issue that you originally reported, especially given that Ikkah said he can reproduce in 3.4 (which doesn't use this "tight bounds" optimization by default, although he may have enabled it). Please let us know if you manage to create a repro for the original issue, and thanks again for uncovering this most recent issue. We really appreciate it Kind regards Kier |
Actually, maybe this is the same issue. The issue is a reported lost pair that doesn't exist. The crash you reported is where we attempt to update the BP when nothing had moved. However, maybe there is a similar edge case where we skip updating some objects in the bounds array because the actors weren't moving, but we adjusted their bounds, thereby missing a pair found event or a pair lost event. It seems like it would be a super rare, totally random edge case caused by the sorted list of bounds being partially unsorted due to this CCD bounds computation issue. Please give the fix a try and report back if the original issue still reproduces? I at first thought this might be a separate issue but, on further thought, this might also be the origin of the issue you were having. |
We do in fact run 3.4 with tight bounds enabled. |
OK. Then definitely, please try this fix. It may not solve the issue, but it is at least worth trying out |
Another detail: this issue also requires eENABLE_STABILIZATION to trigger the crash. |
Hmm, we don't have stabilization enabled. I guess I should try to integrate the fix anyway? That overload of computeBounds() is missing on 3.4, but I suppose computeBounds(bounds, geometry, pose, 0.f, localSpaceBounds, 1.f, false) would work? |
Yes, I think that should be equivalent. This might not actually be the solution for the bug you're reporting, but definitely worth trying out. |
Visual studio debugger console output:
"Exception thrown: read access violation.
cm was nullptr."
Autos output:
Call Stack:
The text was updated successfully, but these errors were encountered: