[cairo] Assert fail and crash problem on cairo 1.12.2

chupakugclct at sina.com chupakugclct at sina.com
Mon Mar 13 10:32:14 UTC 2017


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20170313/625c4df3/attachment.html>


More information about the cairo mailing list