Skip to content
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

vtk & Segmentation faults #1561

Closed
37 opened this issue Feb 29, 2016 · 16 comments · Fixed by #4209
Closed

vtk & Segmentation faults #1561

37 opened this issue Feb 29, 2016 · 16 comments · Fixed by #4209
Labels
module: visualization needs: author reply Specify why not closed/merged yet

Comments

@37
Copy link

37 commented Feb 29, 2016

Hi there, I've been trying to get PCL working for the last few days with no luck, I'm running on arch and have installed PCL1.8 via the AUR, with VTK7.

I'm getting what appear to be VTK related segmentation faults when I attempt to run any PCL visualizer examples. Alleyoop debug screenshot: http://imgur.com/LiISQHj.

As an example, this would trigger a seg. fault:

boost::shared_ptrpcl::visualization::PCLVisualizer simpleVis (pcl::PointCloudpcl::PointXYZ::ConstPtr cloud)

This can also be reproduced with pcl_sim_viewer and any pcd file

I've got vtk7.0.0-1 installed (via arch community), and reinstalled this package a few days ago (after the aur pcl vtk7 patch). Any help would be greatly appreciated!

@37 37 changed the title vtk & Segmentation vaults vtk & Segmentation faults Feb 29, 2016
@RobertSpir
Copy link

I have the same problem in archlinux, but pcl1.8 works with vtk7 when compiled on ubuntu on the same system

@bchretien
Copy link

Note for PCL developers (Arch Linux's package maintainer here): since the default VTK package on Arch Linux is now VTK 7, I merged the recent commits for the OpenGL2 backend and I apply them to the 1.8 RC (see here). The other option is to compile VTK 6 for which I made a legacy package.

@LovelyHorse / @RobertSpir have you tried with the current master branch? I haven't seen other commits related to VTK 7 support, but just in case.

@37
Copy link
Author

37 commented Mar 3, 2016

@bchretien thanks for that! I'll attempt to build from the AUR again in the next couple of days; at the moment I've just compiled the PCL experimental from source and it seems to be working nicely (I'm hesitant to rock the boat until my current project is done).

@bchretien
Copy link

@LovelyHorse so things do work with the master branch + VTK 7? If that's indeed the case (I don't have the time to check myself right now), I can use a recent snapshot rather than try to fix the current RC.

@37
Copy link
Author

37 commented Mar 3, 2016

@bchretien yeah, I did also uninstall the AUR VTK6, and upgraded my VTK7 from 7.0.0-1 to 7.0.0-2 and then built PCL master as follows:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j2
sudo make -j2 install

& it seems to be working nicely, with some exceptions around cuda / opencl conflict handling (possibly unrelated).

@bchretien
Copy link

@LovelyHorse Ok, I'll take a look and re-release the PCL package if things work with master, probably sometime tomorrow. Thanks for the feedback!

@RobertSpir
Copy link

ok, I tried it with pcl-git package from aur. Building it with default PKGBUILD settings
cmake "${srcdir}/pcl" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_apps=ON \ -DBUILD_apps_cloud_composer=ON \ -DBUILD_apps_in_hand_scanner=ON \ -DBUILD_apps_modeler=ON \ -DBUILD_apps_point_cloud_editor=ON \ -DBUILD_examples=ON \ -DBUILD_global_tests=OFF \ -DBUILD_surface_on_nurbs=ON \ -DBUILD_CUDA=ON \ -DBUILD_cuda_io=ON \ -DBUILD_cuda_apps=ON \ -DBUILD_GPU=ON \ -DBUILD_gpu_surface=ON \ -DBUILD_gpu_tracking=ON \ -DBUILD_app_3d_rec_framework=ON \ -DBUILD_simulation=ON
keeps crashing, but when I compiled it with just
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release
then it works...so some of the settings is causing the crashing

@bchretien
Copy link

@RobertSpir did you try to run pcl_sim_viewer?

With the current master (b633abf), default CMake options, I compiled pcl_sim_viewer, and indeed it does fail with the vtkRenderWindowInteractor here. The backtrace is the one that was already reported:

#0  0x0000000000000000 in ?? ()
#1  0x00007fffe2d8f7c7 in vtkOpenGLRenderWindow::GetColorBufferSizes(int*) () from /usr/lib/libvtkRenderingOpenGL2.so.1
#2  0x00007fffe2d90380 in vtkOpenGLRenderWindow::OpenGLInitState() () from /usr/lib/libvtkRenderingOpenGL2.so.1
#3  0x00007fffe2e09fd1 in vtkXOpenGLRenderWindow::Start() () from /usr/lib/libvtkRenderingOpenGL2.so.1
#4  0x00007fffe2e03b67 in vtkXRenderWindowInteractor::Initialize() () from /usr/lib/libvtkRenderingOpenGL2.so.1
#5  0x00007ffff68343aa in pcl::visualization::PCLVisualizer::createInteractor (this=0x55555594b940) at /tmp/pcl/visualization/src/pcl_visualizer.cpp:302
#6  0x00007ffff6833f50 in pcl::visualization::PCLVisualizer::PCLVisualizer (this=0x55555594b940, argc=@0x7fffffffcc4c: 0x2, argv=0x7fffffffd788, name=..., style=0x5555559429f0, create_interactor=0x1) at /tmp/pcl/visualization/src/pcl_visualizer.cpp:270
#7  0x00005555556250b0 in main (argc=0x2, argv=0x7fffffffd788) at /tmp/pcl/simulation/tools/sim_viewer.cpp:871

This looks like a bug in the OpenGL2 backend of VTK. To confirm this, we'd need to make a simple VTK-only repro code, and report it to the VTK bug tracker.

@RobertSpir
Copy link

After spending a looong time recompiling vtk and pcl with debug info I backtracked the crash here but I don't see any reason why it fails there...

@bchretien
Copy link

@RobertSpir thanks a lot for taking the time to do this! This seems to be the same issue as reported here.

@hirennearlab
Copy link

Do you found any solutions? I have the same issues. I have tried with pcl trunk, ros and VTK 7.1 and each time whenever I try to run visualisations, it breaks and I get the segmentation fault.

@gimattiolo
Copy link

gimattiolo commented Jun 1, 2017

Setting glewExperimental=GL_TRUE before glewInit() in vtkOpenGLRenderWindow::OpenGLInitContext() helped in my case.

https://stackoverflow.com/questions/8302625/segmentation-fault-at-glgenvertexarrays-1-vao

@stale
Copy link

stale bot commented May 19, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label May 19, 2020
@kunaltyagi
Copy link
Member

Is this still valid?

@stale stale bot removed the status: stale label May 20, 2020
@kunaltyagi kunaltyagi added needs: author reply Specify why not closed/merged yet module: visualization labels May 20, 2020
@stale
Copy link

stale bot commented Jun 20, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label Jun 20, 2020
@larshg
Copy link
Contributor

larshg commented Jun 23, 2020

I tried looking into this.

But I didn't encounter any runtime errors with windows, VTK9.

I did noticed however, that you have to supply at least two files, with the last one being a vtk file, else it will fail here - alternatively change this line to use index 1.

But I'm not familiar enough with the tool, to properly test it.

Also, a lately std:: prefix was added, but it is fixed in #4209.

@stale stale bot removed the status: stale label Jun 23, 2020
@kunaltyagi kunaltyagi linked a pull request Jun 23, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: visualization needs: author reply Specify why not closed/merged yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants