<div>Hello,</div><div><br></div><div>We are using cairo as our graphic library and the version of the cairo is 1.12.2.</div><div>But we met assert fail and crash problems when the program is running multiple threads, the call stack can be seen below:</div><div><br></div><div>assert fail:</div><div><div>CALLSTACK:</div><div>#0  0x000000380ca32925 in raise () from /lib64/libc.so.6</div><div>#1  0x000000380ca34105 in abort () from /lib64/libc.so.6</div><div>#2  0x000000380ca2ba4e in __assert_fail_base () from /lib64/libc.so.6</div><div>#3  0x000000380ca2bb10 in __assert_fail () from /lib64/libc.so.6</div><div>#4  0x00007fd944ed64f2 in _cairo_hash_table_lookup_exact_key (hash_table=0x277393df0, key=0x213c64238) at cairo-hash.c:506</div><div>#5  0x00007fd944ed6515 in _cairo_hash_table_remove (hash_table=0x277393df0, key=0x213c64238) at cairo-hash.c:523</div><div>#6  0x00007fd944f15c41 in _cairo_scaled_glyph_page_destroy (closure=0x213c62df0) at cairo-scaled-font.c:461</div><div>#7  0x00007fd944ec46fe in _cairo_cache_remove (cache=0x7fd9451a16e0, entry=0x213c62df0) at cairo-cache.c:296</div><div>#8  0x00007fd944ec45eb in _cairo_cache_remove_random (cache=0x7fd9451a16e0) at cairo-cache.c:223</div><div>#9  0x00007fd944ec4629 in _cairo_cache_shrink_to_accommodate (cache=0x7fd9451a16e0, additional=0) at cairo-cache.c:243</div><div>#10 0x00007fd944ec4586 in _cairo_cache_thaw (cache=0x7fd9451a16e0) at cairo-cache.c:179</div><div>#11 0x00007fd944f16885 in _cairo_scaled_font_thaw_cache (scaled_font=0x27a5a0690) at cairo-scaled-font.c:793</div><div>#12 0x00007fd944f18840 in cairo_scaled_font_text_to_glyphs (scaled_font=0x27a5a0690, x=0, y=0, utf8=0x7fd923819ae0 "TestString Hello XX", utf8_len=20, glyphs=0x7fd923819130, num_glyphs=0x7fd92381912c, clusters=0x0, num_clusters=0x0, cluster_flags=0x0)</div><div>    at cairo-scaled-font.c:2079</div><div>#13 0x00007fd944ec35a0 in cairo_text_extents (cr=0x4abc3010, utf8=0x7fd923819ae0 "TestString Hello XX", extents=0x7fd9238191a0) at cairo.c:3090</div></div><div><br></div><div>crash:</div><div><div>#0  0x00007f37bb33b278 in _shi_removeFromFreeList (block=0xfabcad28) at heap.inl:17</div><div>#1  0x00007f37bb33b9ef in _shi_freeVar (mem=<value optimized out>, pageDeleted=0x7f3766659894) at heap.c:2802</div><div>#2  0x00007f37bb33d516 in MemFreePtr (mem=0xfabca3b0) at heap.c:2750</div><div>#3  0x00007f37bb34535f in shi_smpFlushQueue (p=0x8400020) at threads.c:572</div><div>#4  0x00007f37bb33d54b in MemFreePtr (mem=0xfabca3b0) at heap.c:2758</div><div>#5  0x00007f37bb3454b7 in free (p=0xfabcad28) at shmalloc.c:180</div><div>#6  0x00007f3798dd5f84 in _cairo_hash_table_manage (hash_table=0xa08fdb70) at cairo-hash.c:318</div><div>#7  0x00007f3798dd6555 in _cairo_hash_table_remove (hash_table=0xa08fdb70, key=0x828ed910) at cairo-hash.c:535</div><div>#8  0x00007f3798e15c41 in _cairo_scaled_glyph_page_destroy (closure=0x828ec2a0) at cairo-scaled-font.c:461</div><div>#9  0x00007f3798dc46fe in _cairo_cache_remove (cache=0x7f37990a16e0, entry=0x828ec2a0) at cairo-cache.c:296</div><div>#10 0x00007f3798dc45eb in _cairo_cache_remove_random (cache=0x7f37990a16e0) at cairo-cache.c:223</div><div>#11 0x00007f3798dc4629 in _cairo_cache_shrink_to_accommodate (cache=0x7f37990a16e0, additional=0) at cairo-cache.c:243</div><div>#12 0x00007f3798dc4586 in _cairo_cache_thaw (cache=0x7f37990a16e0) at cairo-cache.c:179</div><div>#13 0x00007f3798e16885 in _cairo_scaled_font_thaw_cache (scaled_font=0x956e3d10) at cairo-scaled-font.c:793</div><div>#14 0x00007f3798e18840 in cairo_scaled_font_text_to_glyphs (scaled_font=0x956e3d10, x=0, y=0, utf8=0x7f3799d7d110 "TestString Hello XX", </div><div>    utf8_len=23, glyphs=0x7f3766659cb0, num_glyphs=0x7f3766659cac, clusters=0x0, num_clusters=0x0, cluster_flags=0x0)</div><div>    at cairo-scaled-font.c:2079</div><div>#15 0x00007f3798dc35a0 in cairo_text_extents (cr=0x956e0680, utf8=0x7f3799d7d110 "TestString Hello XX", extents=0x7f3766659d20)</div><div>    at cairo.c:3090</div></div><div><br></div><div>Others may have similar assert problems refer to this thread: http://cairo.cairographics.narkive.com/Ud5Gmsiy/crash-in-glyph-cache</div><div>And I found code of cairo-scaled-font.c has been modified in version 2.12.8, so can we resolve the problem by updating cairo library?</div><div><br></div><div>But similar assert fail problem is found in version 2.12.14 based on this thread: https://lists.cairographics.org/archives/cairo/2013-September/024667.html, is it the same problem?</div><div><br></div><div>And do you have any advice about the solution for the crash problem based on the call stack? Thanks very much!</div><div><br></div><div><br></div><div><br></div>