Summary: | cairo_glyph_path is not multithread safe | ||
---|---|---|---|
Product: | cairo | Reporter: | zadecn <zhaohongchao> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | freedesktop |
Version: | 1.12.2 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
zadecn
2012-06-04 20:25:20 UTC
Silly question, can you please test: diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 59440b2..2f4dbfe 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -2861,8 +2861,10 @@ _cairo_scaled_font_free_last_glyph (cairo_scaled_font_t *scaled_font, _cairo_scaled_glyph_fini (scaled_font, scaled_glyph); if (--page->num_glyphs == 0) { + CAIRO_MUTEX_LOCK (_cairo_scaled_glyph_page_cache_mutex); _cairo_cache_remove (&cairo_scaled_glyph_page_cache, &page->cache_entry); + CAIRO_MUTEX_UNLOCK (_cairo_scaled_glyph_page_cache_mutex); } } (In reply to comment #1) > Silly question, can you please test: > > diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c > index 59440b2..2f4dbfe 100644 > --- a/src/cairo-scaled-font.c > +++ b/src/cairo-scaled-font.c > @@ -2861,8 +2861,10 @@ _cairo_scaled_font_free_last_glyph (cairo_scaled_font_t > *scaled_font, > _cairo_scaled_glyph_fini (scaled_font, scaled_glyph); > > if (--page->num_glyphs == 0) { > + CAIRO_MUTEX_LOCK (_cairo_scaled_glyph_page_cache_mutex); > _cairo_cache_remove (&cairo_scaled_glyph_page_cache, > &page->cache_entry); > + CAIRO_MUTEX_UNLOCK (_cairo_scaled_glyph_page_cache_mutex); > } > } add lock will avoid core? why not add directly other than a patch? (In reply to comment #1) > Silly question, can you please test: > > diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c > index 59440b2..2f4dbfe 100644 > --- a/src/cairo-scaled-font.c > +++ b/src/cairo-scaled-font.c > @@ -2861,8 +2861,10 @@ _cairo_scaled_font_free_last_glyph (cairo_scaled_font_t > *scaled_font, > _cairo_scaled_glyph_fini (scaled_font, scaled_glyph); > > if (--page->num_glyphs == 0) { > + CAIRO_MUTEX_LOCK (_cairo_scaled_glyph_page_cache_mutex); > _cairo_cache_remove (&cairo_scaled_glyph_page_cache, > &page->cache_entry); > + CAIRO_MUTEX_UNLOCK (_cairo_scaled_glyph_page_cache_mutex); > } > } I test it with the lock, but it cores also Hey Behdad, could you take a look at this? AFAIK you looked into thread-safety for text handling. Cairo scaled-font cache locking is too complex for me to fully understand these days. ickle is the only one who still understands that code. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/39. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.