PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.65k stars 4.6k forks source link

crash when displaying pointclouds in release mode #1993

Closed tompollok closed 6 years ago

tompollok commented 6 years ago

:warning: This is a issue tracker, please use our mailing list for questions: www.pcl-users.org. :warning:

I am displaying a point cloud that is reconstructed from a stereo images frame by frame.

the first 1-3 iterations are displayed without a crash, but then i crashes in release mode only while it never happens in debug mode.

I use pcl::visualization::PCLVisualizer* viewer; as a viewer and pcl::PointCloud::Ptr m_ptrCloud; as the data container.

the viewer gets initialzied in the constructor of my display class and the m_ptrCloud gets created every time i want to update my point cloud given the new reconstructed results.

new pointcloud data gets displayed by

if(!viewer->updatePointCloud(m_ptrCloud, "cloud")) { viewer->addPointCloud(m_ptrCloud, "cloud"); }

The error message is as follows:

grafik

Does anyone have an idea?

Your Environment

Expected Behavior

Should not crash as in debug mode.

Current Behavior

crash in release mode after adding the second or third pointcloud

Possible Solution

i dont know

Code to Reproduce

Context

displaying stereo camera reconstruction results in real time, or at least as quickly as the processing/upload pipeline works.

taketwo commented 6 years ago

Please post an MWE to reproduce the problem. This will allow us to narrow down the scope to particular platform, VTK version, etc.

tompollok commented 6 years ago

I tried to create a minimal example and im not able to reproduce this bug in a minimal example. I tested it using the same dll's that were used when the application crashed. do you have an advice what i could possibly do?

--

I tried some desperate std::cout debugging in release mode. The application crashes when i call

viewer->updatePointCloud(m_ptrCloud, "cloud")

taketwo commented 6 years ago

I'm afraid we can not help without a minimal example. The fact that the app crashes on updatePointCloud call does not say much. Maybe it has something to do with your stereo reconstruction (Is it running on the same thread?). Maybe it has something to do with the new VTK version. Maybe it's a bug in VTK on Windows. Everything is possible.

tompollok commented 6 years ago

I tried to create a minimal example, but i failed reproducing the crash. It works as expected in the minimal example :/

I created a processing pipeline that loads stereo images, estimates a disparity map using opencv and created a 3d point cloud from the disparity map. The stereo reconstruction is opencv accelerated.

If i manage to create a minimal example that reproduces the crash, then ill upload it here.

tompollok commented 6 years ago

I found out that as we built pcl (1.8.1) and all its dependencies ourself, the vtk 8 library was unfortunately built only in debug. Unfortunately VTK does not append a d or _debug suffix, but make use of a Realse and Debug destintation folder for the built library.

So with vtk 8 compiled in release mode, the application runs perfectly while in the debug mode i get a crash similiar to what i described for when i run the application in release mode with debug VTK.

taketwo commented 6 years ago

Thanks for investigating. I don't think there is something we can do about this on the PCL side, so closing it. Please reopen and propose changes in case you don't agree.