ICEpdf
  1. ICEpdf
  2. PDF-697

TrueType font class is not thread safe when parsing shared resources.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.4
    • Fix Version/s: 5.0.5
    • Component/s: Font Engine
    • Labels:
      None
    • Environment:
      any

      Description

      A support request with two support files came in which exhibited many console exceptions when loading the sample files with two threads.

        Issue Links

          Activity

          Hide
          Patrick Corless added a comment -

          The files in question contain fonts that are shared as resources across multiple files. The underlying data structure for the font is not thread safe having a byte[] indexer that could be manipulated by another thread. So as the glyphs are parsed lazily it's possible for the the byte[] pointer to move incorrectly for a concurrent parse.

          For the time being I've made the byte[] pointer thread local which seems to fix the issue. Further testing is needed to verify the fix as well as track down any further issues.

          Show
          Patrick Corless added a comment - The files in question contain fonts that are shared as resources across multiple files. The underlying data structure for the font is not thread safe having a byte[] indexer that could be manipulated by another thread. So as the glyphs are parsed lazily it's possible for the the byte[] pointer to move incorrectly for a concurrent parse. For the time being I've made the byte[] pointer thread local which seems to fix the issue. Further testing is needed to verify the fix as well as track down any further issues.
          Hide
          Patrick Corless added a comment -

          Client seems to be happy with this fix, marking as resolved.

          Show
          Patrick Corless added a comment - Client seems to be happy with this fix, marking as resolved.

            People

            • Assignee:
              Patrick Corless
              Reporter:
              Patrick Corless
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: