-
Notifications
You must be signed in to change notification settings - Fork 109
Avoid NULL deref in KillFace() from tessMeshConnect(). #72
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
Conversation
|
I don't understand the flow of the algorithm well enough to be able to eyeball it - but might it be ok to instead just guard the call to |
|
Your PR changes tessMeshConnect() but you talk about KillFace(). You will need to elaborate what you're doing :) |
|
In
I don't understand the operation of the algorithm well enough to be certain one way or other, but I wonder if potentially just guarding against passing a For example, in I hesitate to suggest this, however, because I'm not sure if this situation ( |
|
I think we're in "this should never happen" territory, and I suspect something else went wrong earlier. Do you have more info what leads into the crash? One feature of the tessellator is that it creates sentinel edges around the data. All other edges should have valid faces, except the far sides of the sentinel edges. My best guess is that you have a case where the input has NaNs or very big numbers which messes up the sentinel stuff. |
|
Are you working together with @sfreilich ? He's currently looking into the too-big-coords stuff: #71 |
|
We're on different teams, but yes. Though maybe should be coordinating at a bit more fine-grained level. We're both working on fuzz-tests that are slightly downstream, there's presumably a lot of overlap. (Looking forward to your take on my latest attempt at that other PR, though I'm on vacation until Thursday.) |
|
As @sfreilich mentions, we're on different teams that both use libtess2. My team doesn't have proper fuzz tests for our libtess2 usage at the moment - but we do have a massive dataset that spits out crash reports from time to time when we process it :) Let me see if I can better isolate the inputs that are involved with this crash specifically. |
|
I've managed to produce a minimal input set that produces this error, which is an with call stack: With the following data failing the assert: The test case that produces this assertion failure: I've not looked into this further, and may not be able to for at least the next few days because of other commitments. Any ideas? |
|
There's collinear edges in the input, which is likely the culprit. Smells something very similar to: #37 Can you test if reverting the CL fixes things? I think we should revert that CL, and see if there's alternative fix for the original issue. |
|
Correct. Good to know, I think we should revert that CL then as a fix. #22 may require different kind of fix then. |
This reverts commit 2cb8aed.
This reverts commit 955761f. This fixes a crash noticed in memononen#72.
|
Closing in favor of #73. |
|
Thanks! I merged the fix, and reopened #22. |
This avoids a
NULLderef inKllFace()that occurs whenNULLis passed as the face to delete.