-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Visualization] CloudViewer segfaults with PCL 1.12.1 and VTK 9.1 on Ubuntu 22.04 #5237
Comments
I can verify that it crashes. Also other examples when the interator object is used / destroyed. But it seems to be an issue in VTK - or miuse from PCL, with some new changes that we haven't taken into consideration. |
I investigated and here is what I found: Possible solutions:
A possible workaround on the PCL user side could be to replace |
I have verified the same problem. I am running Ubuntu 22.04 with the distro versions of the libs. The order of events on my system is: Calling PCLVisualizer::SpinOnce() sets a timer that results in PCLVisualizer::ExitMainLoopTimerCallback getting called. At some point later I am still trying to wrap my head around this logic in PclVisualizer::SpinOnce:
My best understanding is that the only way to stop the interactor (necessary for spinonce) is to use that timer to call TerminateApp. Since terminate always destroys the Display object (even in older versions of VTK), I am unclear how the display object is meant to be preserved. |
I have tried using VTK with the XRenderWindowInteractor patches that are currently on master. This fixes the segmentation fault, but there is still the same fundamental problem using the visualizer with spin once. Calling TerminateApp to stop the interactor now sets a Done flag that causes the XWindow to get closed. PCL may need a custom Interactor that has a bool flag on that TerminateApp function that selectively sets the Done flag so that it can terminate the interactor event loop without closing the window. As it is now, as soon as SpinOnce is called, the window just closes. |
@pionex I am currently looking into whether ProcessEvents can be used in spinOnce. It sounds like that would be the right way. But I think ProcessEvents is only available in newer VTK versions (>= VTK 9?) |
@mvieth - Good catch - I just tried a quick and dirty version and it works well. The interactor->Start() method calls the Initialize() method if it hasn't been called. I haven't yet found a way to access that internal state, so I just used a static variable in the PCLVisualizer::spinOnce method to call this once and otherwise just call processEvents(). I don't have any code for the spin rate at the moment, but seems like this is promising. |
Pull request #5252 is merged, so this problem is fixed on the master branch. |
I'm sorry, I don't get it |
You have to build from master. |
OK, It worked!! Nice!! |
I tried building from master on Ubuntu 22.04 with Qt 5.15.3 and I got this error when I ran
|
Same Issue here, but instead I tried to build w. Qt6. But this seems to be a different problem. Just set the corresponding build Option: -DWITH_QT:BOOL=OFF |
I can verify it crashes with same issue ig no one has solved it yet....... |
The following api should be a call abandoned interface, you can use the new interface@senickoabandoned:
|
Basic CloudViewer example compiles without any problem, but after running produced executable window appears and immediately dissapears and segmentation fault error is printed to the console.
Exact console output
Sometimes a warning is shown about deprecation of some things in VTK 9.0. As an example one of them says:
This is output produced by gdb
Context
I want to create a simple app that will show some points in 3D space. I've installed PCL with
apt install libpcl-dev
. Then I've created a new project with the help of Using PCL in your own project tutorial. Finally I wrote a simple app that should just show the window.Expected behavior
Window should open.
Current Behavior
Window appears and immediately dissapears and segmentation fault error is printed to console.
To Reproduce
sudo apt install libpcl-dev
mkdir build && cd build && cmake ..
make && ./main
Screenshots/Code snippets
This is my CMakeList.txt
and this is my main.cpp
I saw #5195, but I didn't find any solutions there.
I've tried to downgrade PCL to version 1.11.1 but for some reason after building from source it turned out that visualization module wasn't compiled and I couldn't figure out why. I've also tried to downgrade vtk to 7.1 too but I couldn't manage to compile it from source due to errors that were thrown for unknown reason.
The text was updated successfully, but these errors were encountered: