PointCloudLibrary / PointCloudLibrary/pcl

visualization crash on MacOS Mojave

Open
#2,753 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Trying to run the simple cloud visualization example from:
http://www.pointclouds.org/documentation/tutorials/cloud_viewer.php#cloud-viewer
on MacOS Mojave, running VTK built from master branch and PCL built
from master branch, I am getting the following error:

2018-12-30 02:08:14.191 cloud_viewer[11042:1222647] *** Terminating
app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'NSWindow drag regions should only be invalidated on the Main
Thread!'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff32b1cecd
__exceptionPreprocess + 256
1   libobjc.A.dylib                     0x00007fff5ebe4720
objc_exception_throw + 48
2   CoreFoundation                      0x00007fff32b3695d
-[NSException raise] + 9
3   AppKit                              0x00007fff30037c8e
-[NSWindow(NSWindow_Theme)
_postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 324
4   AppKit                              0x00007fff3003507c -[NSWindow
_initContent:styleMask:backing:defer:contentView:] + 1488
5   AppKit                              0x00007fff30034aa6 -[NSWindow
initWithContentRect:styleMask:backing:defer:] + 45
6   libvtkRenderingOpenGL2-8.2.1.dylib  0x000000010bda8b18
_ZN20vtkCocoaRenderWindow13CreateAWindowEv + 1736
7   libvtkRenderingOpenGL2-8.2.1.dylib  0x000000010bdaa49b
_ZN20vtkCocoaRenderWindow10InitializeEv + 59
8   libvtkRenderingOpenGL2-8.2.1.dylib  0x000000010bf9e101
_ZN21vtkOpenGLRenderWindow5StartEv + 49
9   libvtkRenderingOpenGL2-8.2.1.dylib  0x000000010bdaa3cf
_ZN20vtkCocoaRenderWindow5StartEv + 31
10  libvtkRenderingOpenGL2-8.2.1.dylib  0x000000010bdc0537
_ZN30vtkCocoaRenderWindowInteractor10InitializeEv + 727
11  libpcl_visualization.1.9.dylib      0x0000000105f8cc43
_ZN3pcl13visualization13PCLVisualizer16createInteractorEv + 451
12  libpcl_visualization.1.9.dylib      0x0000000105f8c0cd
_ZN3pcl13visualization13PCLVisualizerC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEb
+ 685
13  libpcl_visualization.1.9.dylib      0x0000000105f8d08c
_ZN3pcl13visualization13PCLVisualizerC1ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEb
+ 44
14  libpcl_visualization.1.9.dylib      0x0000000105e8a867
_ZN3pcl13visualization11CloudViewer16CloudViewer_implclEv + 87
15  libpcl_visualization.1.9.dylib      0x0000000105e8a01c
_ZN5boost6detail11thread_dataINS_17reference_wrapperIN3pcl13visualization11CloudViewer16CloudViewer_implEEEE3runEv
+ 28
16  libboost_thread-mt.dylib            0x00000001065e62c8
_ZN5boost12_GLOBAL__N_112thread_proxyEPv + 136
17  libsystem_pthread.dylib             0x00007fff5fea6305 _pthread_body + 126
18  libsystem_pthread.dylib             0x00007fff5fea926f _pthread_start + 70
19  libsystem_pthread.dylib             0x00007fff5fea5415 thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

The call stack above is on thread 2.

I guess some changes are needed in
visualization/src/cloud_viewer.cpp:134 in order to allow the
PCLVisualizer pointer viewer_ to be created in the "main" thread (it
looks like Apple broke a lot of people with this one).

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 by running the simple cloud visualization example linked in the issue on macOS Mojave, then inspect visualization/src/cloud_viewer.cpp:134 and the PCLVisualizer creation path shown in the stack trace. Confirm that the visualization no longer raises the main-thread NSWindow exception when the example is run.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.