I think I’m currently hitting this old bug; I’ve commented on it, but I’m not sure anybody will see it there.
My issue: I run two separate render threads, one addressing a VR render window, the other addressing screen rendering; and whenever both threads have to render a text (the same one, actually), either one of them spuriously hits some nullptr glyph in vtkfreetype-…dll. A call stack of one of these crashes (they sometimes occurred at different positions as well I think, I’ll keep you posted):
vtkfreetype-9.4d.dll!ftc_inode_weight(FTC_NodeRec_ * ftcinode, FTC_CacheRec_ * ftccache) Line 118
vtkfreetype-9.4d.dll!ftc_node_destroy(FTC_NodeRec_ * node, FTC_ManagerRec_ * manager) Line 296
vtkfreetype-9.4d.dll!FTC_Manager_Compress(FTC_ManagerRec_ * manager) Line 568
vtkfreetype-9.4d.dll!ftc_cache_add(FTC_CacheRec_ * cache, unsigned __int64 hash, FTC_NodeRec_ * node) Line 435
vtkfreetype-9.4d.dll!FTC_Cache_NewNode(FTC_CacheRec_ * cache, unsigned __int64 hash, void * query, FTC_NodeRec_ * * anode) Line 470
vtkfreetype-9.4d.dll!vtkfreetype_FTC_CMapCache_Lookup(FTC_CMapCacheRec_ * cmap_cache, void * face_id, int cmap_index, unsigned int char_code) Line 268
vtkRenderingFreeType-9.4d.dll!vtkFreeTypeTools::GetGlyphIndex(unsigned __int64 tprop_cache_id, unsigned int c, unsigned int * gindex) Line 826
vtkRenderingFreeType-9.4d.dll!vtkFreeTypeTools::GetBitmap(unsigned int c, FTC_ScalerRec_ * scaler, unsigned int & gindex, FT_BitmapGlyphRec_ * & bitmap_glyph) Line 2291
vtkRenderingFreeType-9.4d.dll!vtkFreeTypeTools::CalculateBoundingBox(const std::string & str, vtkFreeTypeTools::MetaData & metaData, const std::string & defaultHeightString) Line 1372
vtkRenderingFreeType-9.4d.dll!vtkFreeTypeTools::CalculateBoundingBox(const vtkStdString & str, vtkFreeTypeTools::MetaData & metaData) Line 1317
vtkRenderingFreeType-9.4d.dll!vtkFreeTypeTools::GetMetrics(vtkTextProperty * tprop, const vtkStdString & str, int dpi, vtkTextRenderer::Metrics & metrics) Line 520
vtkRenderingFreeType-9.4d.dll!vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(vtkTextProperty * tprop, const vtkStdString & str, vtkTextRenderer::Metrics & metrics, int dpi, int backend) Line 154
vtkRenderingCore-9.4d.dll!vtkTextRenderer::GetMetrics(vtkTextProperty * tprop, const vtkStdString & str, vtkTextRenderer::Metrics & metrics, int dpi, int backend) Line 196
Does anyone have an idea how I could quickly fix / work around this problem? Splitting up the application into a screen rendering and a VR rendering part (which also means having to introduce messaging between the two) does not sound like an appealing option at this point as it would be a very time-consuming endeavour…
Any text rendering in VTK is probably using freetype, so I cannot avoid using it if I want to show some text I guess?