-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
I have been trying to work with pointclouds with sizes above the 300 million points. The creation of the cloud (as a PCD file) seems to be fine but its later visualization is impossible; it always crashes.
I have been studying this issue with different programs. For that I created a random cloud with 300M points. When I tried to load the (4.5 GB) PCD file with pcl::io::loadPCDFile the program crashes at:
[conversions.h] fromPCLPointCloud2, line 212 (in the memcpy)
else
{
// If not, memcpy each group of contiguous fields separately
for (uint32_t row = 0; row < msg.height; ++row)
{
const uint8_t* row_data = &msg.data[row * msg.row_step];
for (uint32_t col = 0; col < msg.width; ++col)
{
const uint8_t* msg_data = row_data + col * msg.point_step;
BOOST_FOREACH (const detail::FieldMapping& mapping, field_map)
{
memcpy (cloud_data + mapping.struct_offset, msg_data + mapping.serialized_offset, mapping.size);
}
cloud_data += sizeof (PointT);
}
}
}
The memcpy fails when col = 30000000 (30M).
If instead of loading the PCD file I directly generate a random point cloud and try to visualize it the crash is harder to understand. I did this with the a pcl::visualization::CloudViewer object and got the following backtrace:
(gdb) bt
#0 0x00007f7c8df6ce9d in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f7c8218bcab in ?? () from /usr/lib/nvidia-current/libnvidia-glcore.so.319.37
#2 0x00007f7c8218c92e in ?? () from /usr/lib/nvidia-current/libnvidia-glcore.so.319.37
#3 0x00007f7c8a5dc8aa in vtkOpenGLPainterDeviceAdapter::SendAttribute(int, int, int, void const*, long long) () from /usr/lib/libvtkRendering.so.5.8
#4 0x00007f7c8a4fa45c in vtkPointsPainter::RenderPrimitive(unsigned long, vtkDataArray_, vtkUnsignedCharArray_, vtkDataArray_, vtkRenderer_) () from /usr/lib/libvtkRendering.so.5.8
#5 0x00007f7c8a50772e in vtkPrimitivePainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#6 0x00007f7c8a4fff6b in vtkPolyDataPainter::Render(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#7 0x00007f7c8a414261 in vtkChooserPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#8 0x00007f7c8a4fff6b in vtkPolyDataPainter::Render(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#9 0x00007f7c8a4fff6b in vtkPolyDataPainter::Render(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#10 0x00007f7c8a5f5917 in vtkOpenGLRepresentationPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#11 0x00007f7c8a4fff6b in vtkPolyDataPainter::Render(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#12 0x00007f7c8a5d9370 in vtkOpenGLLightingPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#13 0x00007f7c8a4fff6b in vtkPolyDataPainter::Render(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#14 0x00007f7c8a5c69de in vtkOpenGLDisplayListPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#15 0x00007f7c8a5c5d18 in vtkOpenGLClipPlanesPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#16 0x00007f7c8a5f5fd9 in vtkOpenGLScalarsToColorsPainter::RenderInternal(vtkRenderer_, vtkActor_, unsigned long, bool) () from /usr/lib/libvtkRendering.so.5.8
#17 0x00007f7c8a4d60b2 in vtkPainterPolyDataMapper::RenderPiece(vtkRenderer_, vtkActor_) () from /usr/lib/libvtkRendering.so.5.8
#18 0x00007f7c8a4ff2ce in vtkPolyDataMapper::Render(vtkRenderer_, vtkActor_) () from /usr/lib/libvtkRendering.so.5.8
#19 0x00007f7c8a41cdfa in vtkDataSetMapper::Render(vtkRenderer_, vtkActor_) () from /usr/lib/libvtkRendering.so.5.8
#20 0x00007f7c8a5c4fa2 in vtkOpenGLActor::Render(vtkRenderer_, vtkMapper_) () from /usr/lib/libvtkRendering.so.5.8
#21 0x00007f7c8a4c5fc9 in vtkLODActor::Render(vtkRenderer_, vtkMapper_) () from /usr/lib/libvtkRendering.so.5.8
#22 0x00007f7c8a4c5e5f in vtkLODActor::RenderOpaqueGeometry(vtkViewport*) () from /usr/lib/libvtkRendering.so.5.8
#23 0x00007f7c8a51d4ee in vtkRenderer::UpdateGeometry() () from /usr/lib/libvtkRendering.so.5.8
#24 0x00007f7c8a5f1f02 in vtkOpenGLRenderer::DeviceRender() () from /usr/lib/libvtkRendering.so.5.8
#25 0x00007f7c8a5206dc in vtkRenderer::Render() () from /usr/lib/libvtkRendering.so.5.8
#26 0x00007f7c90070851 in pcl::visualization::PCLVisualizer::resetCameraViewpoint (this=0x7f7c6c0008e0, id=...) at /usr/pcl/visualization/src/pcl_visualizer.cpp:1964
#27 0x00007f7c9009ba3b in pcl::cloud_showpcl::PointCloud<pcl::PointXYZRGB >::poppcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB > (this=this@entry=0x2251320, handler=...) at /usr/pcl/visualization/src/cloud_viewer.cpp:70
#28 0x00007f7c90094fd1 in pcl::cloud_showpcl::PointCloud<pcl::PointXYZRGB >::pop (this=0x2251320) at /usr/pcl/visualization/src/cloud_viewer.cpp:110
#29 0x00007f7c90096da1 in pcl::visualization::CloudViewer::CloudViewer_impl::operator() (this=0x2250e70) at /usr/pcl/visualization/src/cloud_viewer.cpp:191
#30 0x00007f7c8dc106c9 in ?? () from /usr/lib/libboost_thread.so.1.49.0
#31 0x00007f7c91176e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#32 0x00007f7c8df11ccd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#33 0x0000000000000000 in ?? ()
I am using the trunk version of PCL in a Ubuntu 12.10 64 bits desktop computer with 64 GB of RAM and a graphic card Nvidia GeForce GTX 680 (4 GB of memory). I don't think the problem is due to a memory limitation. It must be something else.
Please, could you tell someone tell me how to contribute with more information about this issue? (the core file size is 49 GB).