Summary: | Crash in harfbuzz when destroying ressources | ||
---|---|---|---|
Product: | HarfBuzz | Reporter: | fuhrmann_mail |
Component: | src | Assignee: | Behdad Esfahbod <freedesktop> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | freedesktop, hakuro |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | harfbuzz debug log |
Description
fuhrmann_mail
2014-11-14 23:02:09 UTC
Any chance you can bisect further down to find which commit caused it? I tried a bisect by hand (because of all these buildsystem changes). It turns out https://github.com/behdad/harfbuzz/commit/45fd9424c723f115ca98995b8f8a25185a6fc71d seems to be the first faulty commit. There was a bug like that, but was fixed by this: https://github.com/behdad/harfbuzz/commit/27674b4bb351e501373bd9994e4ba6546e465cf7 which went into 0.9.22. Can you rewind your bisect and work on 0.9.22 forward only? Thanks. I just tried 0.9.22, but the same crash happens with this version. Any idea which font causes this? For testing, you can use the sample linked here: https://trac.videolan.org/vlc/ticket/12733 This sample produces the following ass related debug output, so I assume the font in question is Tamil Sangam MN Bold (they are two different subtitle fonts shown at the same time). [ass] [0x10023e880]: Warning: no style named 'testi' found, using 'Default' [ass] [0x10023e880]: Warning: no style named 'Karaoke' found, using 'Default' [ass] Neither PlayResX nor PlayResY defined. Assuming 384x288 [ass] fontconfig: cannot find font 'Anime Ace 2.0 BB', falling back to 'Tamil Sangam MN Bold' [ass] [0x10023e880]: Warning: no style named 'testi' found, using 'Default' The crash can be reproduced on recent OS X versions, I did not tested windows or linux builds so far. Then again, I doubt this issue is specific to any font file. We got quite a lot complaints about this crash from various users recently, for instance also with this sample file: https://dl.dropboxusercontent.com/u/48175551/example_subtitles.ass It only states that normal Arial shall be used. Humm. I have no idea how to proceed. It's hard to imagine it's an obvious bug in HarfBuzz itself as we don't see it in other integrations. So someone who can reproduce needs to debug. Try compiling HarfBuzz with -DHB_DEBUG_OBJECT=100 and see if there's anything suspicious, or paste the log here. Thanks. Created attachment 110370 [details]
harfbuzz debug log
Here is a debug log from harfbuzz (with latest hb version). I'm not familiar with the code myself, and the log seems to only contain ref count info. Does this help?
Ok, I talked to someone else who had a similar issue. We believe that you might be releasing FT_Face before hb_face_t / hb_font_t. That definitely explains the problem. However, I also made a commit that should avoid this problem. Do fix it on your side though. commit 395b35903e052aecc97d0807e4f813c64c0d2b0b Author: Behdad Esfahbod <behdad@behdad.org> Date: Sun Dec 28 16:03:26 2014 -0800 Avoid accessing layout tables at face destruction "Fixes" https://bugs.freedesktop.org/show_bug.cgi?id=86300 Based on discussion someone else who had a similar issue, most probably the user is releasing FT_Face before destructing hb_face_t / hb_font_t. While that's a client bug, and while we can (and should) use FreeType refcounting to help avoid that, it happens that we were accessing the table when we didn't really have to. Avoid that. Here's a patch for libass to fix the destruction ordering: https://github.com/libass/libass/pull/155 Thanks for the investigation. I tried both fixes with VLC, and they work fine. |
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.