-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
PLY point clouds without a mesh crash the program #1917
Comments
Stack trace:
|
I think there is two issues here:
|
Hello! I'm working on this problem. There are two ply element creations and deletions, but the second one involves uninitialized heap memory that later gets freed. I'll continue tomorrow—I’ve spent some time on it. It seems there should be better initialization since the freeing code assumes all pointers are valid and doesn’t check for NULL(and pointer is not null just not initialized). Overall it is not good to see C-style memory management in C++ code, but I guess there are reasons for it :) |
That code is OLD. Thanks for investigating! (btw we have a discord, feel free to join if thats your thing @exbluesbreaker : https://discord.f3d.app) |
I joined, just didn't yet talk there) |
Hello! So it seems I figure out the issue.
The issue is the absence of polygons, which means also no properties are allocated, leaving props uninitialized. As a result, free is called on an invalid pointer, causing a crash. In
Place of crash without check:
I will prepare MR for VTK with fix for it. Also here is result of display of ply file. I doesn't look exactly like dog to me, but who knows :) |
Ive seen that sometimes, with other files, i think its another bug. |
I created this pull request |
I could have sworn this was viewable in something but yeah everything I'm trying now is not opening it due to not having any faces... Oh found it So it has valid data, maybe nothing is coded to display it? (This particular example was only IR so the only color is white but they can have colors as well) |
I guess the distinction here being it's a point cloud and not a 3D model so maybe it's not within scope for F3D to display? RTAB-Map renders these with VTK so the underlying support should be there. |
Yeah maybe there is something of with visualization, according to file there should be 139777 points, but in f3d visualization there are definitely less, I guess small rectangles correspond to single point. |
I can try to open it tomorrow in Matlab at work (it probably should support it and I also should have probably necessary toolbox). |
It definitely is in the scope of F3D :) |
Lets fix the crash first, we will figure out if a rendering fix is needed after :) |
Describe the bug
When trying to open a PLY that is just a colored point cloud, F3D says there's no faces, but also crashes.
This is generated from RTAB-Map's default export options. RTAB-Map's viewer is also VTK so I believe this should work.
To Reproduce
Steps to reproduce the behavior:
f3d dog.ply
Expected behavior
A graceful exit at least (possibly supporting this type of PLY)
System Information:
F3D Information
Additional context
File
dog.zip
The text was updated successfully, but these errors were encountered: