-
Notifications
You must be signed in to change notification settings - Fork 27
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
Memory error in the in/out query #1167
Comments
Thanks for reporting this @agcapps. That's not a lot to go on...
Any chance, the following change helps? diff --git a/src/axom/primal/operators/clip.hpp b/src/axom/primal/operators/clip.hpp
index b80a08408..d375a7371 100644
--- a/src/axom/primal/operators/clip.hpp
+++ b/src/axom/primal/operators/clip.hpp
@@ -51,9 +51,10 @@ Polygon<T, 3> clip(const Triangle<T, 3>& tri, const BoundingBox<T, 3>& bbox)
// Use two polygons with pointers for 'back-buffer'-like swapping
const int MAX_VERTS = 6;
- PolygonType poly[2] = {PolygonType(MAX_VERTS), PolygonType(MAX_VERTS)};
- PolygonType* currentPoly = &poly[0];
- PolygonType* prevPoly = &poly[1];
+ PolygonType poly0(MAX_VERTS);
+ PolygonType poly1(MAX_VERTS);
+ PolygonType* currentPoly = &poly0;
+ PolygonType* prevPoly = &poly1;
// First check if the triangle is contained in the bbox, if not we are empty
BoundingBoxType triBox; If not, since you mentioned Umpire, would it be possible to rebuild your application with additional Umpire diagnostics enabled? |
Thanks. You're right; it's not a lot to go on. I'll see if the user can try out the suggestion. |
Some more details:
|
is setting omp num threads to 1 a clue that there may be a memory (or thread safety) isssue in the in-out implementation? |
I have been unable to reproduce the crash with the Umpire error message "Cannot find allocator for pointer: ." In the meantime, several fixes (in particular, those upstreamed to us in #1204 ) went in to the copy of Axom. I propose to close this bug, to be reopened if the problem reappears. |
Closing as can't reproduce. |
User reports an Umpire error message saying "Cannot find allocator for pointer: ." Here is an excerpt of the stack trace, deepest at top:
~axom::Array
~axom::Polygon
axom::primal::clip
quest::inOutOctree<3>::withinGrayBlock
The crash is in clip.hpp, line 100, when it goes out of scope. I think from the stack allocated poly[2] array (line 54). The poly array entries are passed back to the caller and copied into separate variables. I'm not sure if the m_vertices are being copied correctly. In particular, does the destructor called when clip() goes out-of-scope occur before or after the assignment of the new polygon.
This is a very large problem. The user's code is using the in/out query to process STL files; the error occurs on the second file. That file may not be available for us to troubleshoot.
The text was updated successfully, but these errors were encountered: