PointCloudLibrary / PointCloudLibrary/pcl

[OSX] [VTK6.3] PCLVisualizer::wasStopped() doesn't return true after closing window when using multiple PCLVisualizers in a program

Open
#1,512 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: visualization needs: testing platform: macos
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

The same error reported in #1390 happens when using multiple PCLVisualizers in a program. A minimal test case is as follows:

#include <iostream>
#include <pcl/visualization/pcl_visualizer.h>

void f1() {
  auto viewer = pcl::visualization::PCLVisualizer::Ptr(
      new pcl::visualization::PCLVisualizer("Test"));
  while (!viewer->wasStopped()) {
    viewer->spinOnce();
  }
}

int main() {
  f1(); // First time, it works as expected
  f1(); // Second time, ERROR happens
  return 0;
}

Error messages:

ERROR: In /tmp/vtk20151007-78273-1tax4sc/VTK-6.3.0/Rendering/OpenGL/vtkOpenGLPolyDataMapper2D.cxx, line 442
vtkOpenGLPolyDataMapper2D (0x7fd1fc70a410): failed after RenderOverlay 1 OpenGL errors detected
  0 : (1286) Invalid framebuffer operation


ERROR: In /tmp/vtk20151007-78273-1tax4sc/VTK-6.3.0/Rendering/OpenGL/vtkOpenGLRenderer.cxx, line 1202
vtkOpenGLRenderer (0x7fd1fc7069b0): failed after Clear 1 OpenGL errors detected
  0 : (1286) Invalid framebuffer operation

After a little digging into the problem, I found that win_->IsDrawable () (pcl_visualizer.cpp#L472) returns false for the first time when I close the window, but true for the second time.

I'm testing on osx 10.10.4.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal C++ reproduction and inspect visualization/src/pcl_visualizer.cpp around the referenced win_->IsDrawable() check. Trace the window lifecycle across the two PCLVisualizer instances on macOS, then verify that closing the second window makes wasStopped() return true without the reported OpenGL framebuffer errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.