ManiVaultStudio / t-SNE-Analysis

t-SNE and HSNE analysis plugin for ManiVault
GNU Lesser General Public License v3.0
1 stars 1 forks source link

TSNE crashes on macos with error concerning NSOpenGLContext not called from main thread #120

Open bldrvnlw opened 3 weeks ago

bldrvnlw commented 3 weeks ago

In the attached file the crucial event seems to be making the OpenGLContext current in another thread.

Thread 8 Crashed:: QThread
0   AppKit                              0x7ff81747938b -[NSOpenGLContext setView:] + 191
1   libqcocoa.dylib                        0x10e546766 0x10e4cb000 + 505702
2   libqcocoa.dylib                        0x10e545f60 0x10e4cb000 + 503648
3   QtGui                                  0x112aed457 QOpenGLContext::makeCurrent(QSurface*) + 167
4   libTsneAnalysisPlugin.dylib            0x150df31a6 OffscreenBuffer::initialize() + 118
5   libTsneAnalysisPlugin.dylib            0x150df65e6 TsneWorker::compute() + 246

Should this be done in the main thread and then passed to the worker? But why only on MacOS?

tsne_macos.txt

jeggermont commented 3 weeks ago

The OffscreenBuffer should probably be created in the main thread rather than a worker thread on macos.