-
Notifications
You must be signed in to change notification settings - Fork 658
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
test_pruning fails under Windows #53
Comments
Weird, I would guess that overly aggressive optimization could be a problem but here it's the other way around only Debug is problematic? To debug further you could output the explicit node values before and after updating. Does the problem also affect earlier releases (1.6, 1.5, 1.4)? |
Regarding the different pointers: That could happen and is a valid behavior. After you update 8 child nodes of a parent identically, the children get auto-pruned since the parent already contains the information. Searching for any coordinate within a child will then return the pointer to the parent. That behavior was introduced with v1.6. |
So we tried several things and we're trying to nail it down but with not a lot of success. We've seen some strange behavior which seems to relate to the Visual Studio compiler/debugger. It was possible to create an even smaller testcase which just consists of 8 nodes being updated as occupied, and it has the bug as well. I then tried the 1.5.6 version (which supposedly doesn't have autopruning) and there test_pruning seems to work just fine, no errors. Could you give me some information what the major changes for autopruning where? I will then try to dig into it a little deeper. |
Thanks for digging into this! The autopruning commit in question was b3ca41b. Although there are other changes in the range v1.5.4...v1.6.0 that could be the culprit... => git bisect? |
I got exactly the same behavior than merfels, so I digged into the code and I think I have located the bug: Following function in OccupancyOcTreeBase.hxx
returns the pointer to the node, where the value has been updated. Now when the pruning happens the function will still return the pointer to the node, which was updated. Unfortunately this node was been deleted by the pruning before, so the function will return an invalid pointer.
with this one:
I still don't know why the VisualStudio Debug compiler overwrites the memory after the delete (in the pruning function), but anyways returning a invalid pointer appears to be a bug for me. ;) |
Good catch! Other compilers should at least result in a segfault when accessing the invalid (pruned) node, but I guess the deletion gets postponed due to some optimization. I'll also add a unit test that catches this error. |
Fixed, along with a unit test that would also fail on Linux / gcc. Let me know if there are still issues with VS! |
Hi,
the test case test_pruning fails under Windows 64bit Visual Studio 2010 for unknown reason. This is a minimal code example which shows the same behavior:
In this setup, it will return false for tree.isNodeOccupied(node) for (x,y,z) = (0.015, 0.015, 0.015) and I have no idea why. It works under Linux though. If you add the commented part (tree.search()) then you will notice that this function returns another pointer than tree.updateNode(), and then isNodeOccupied yields true. Do you have any idea why this code doesn't work?
Edit: so everything I stated above is true for when you compile it in Debug mode, but there seems to be no problem in Release mode?!
Best,
Christian
The text was updated successfully, but these errors were encountered: