Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5460

Deadlock in TrueTypeFont and RAFDataStream

    XMLWordPrintableJSON

Details

    Description

      Deadlock is happening between org.apache.fontbox.ttf.RAFDataStream and org.apache.fontbox.ttf.TrueTypeFont objects. Below is the stack trace of the two threads which are in deadlock. If you want to see the complete thread dump you can refer it here.

       

      APP_Thread_50408_759_100162222_WorkerTask_1652842343227_P_Th_SPR-APP-pool-5-thread-6
      PRIORITY : 5
      THREAD ID : 0X00007F894C406000
      NATIVE ID : 0X44D1
      NATIVE ID (DECIMAL) : 17617
      STATE : BLOCKED
      stackTrace:
      java.lang.Thread.State: BLOCKED (on object monitor)
      at org.apache.fontbox.ttf.TrueTypeFont.getTable(TrueTypeFont.java:147)
      - waiting to lock <0x00000002d216fec8> (a org.apache.fontbox.ttf.TrueTypeFont)
      at org.apache.fontbox.ttf.TrueTypeFont.getHorizontalMetrics(TrueTypeFont.java:229)
      at org.apache.fontbox.ttf.GlyphTable.getGlyphData(GlyphTable.java:210)
      at org.apache.fontbox.ttf.GlyphTable.getGlyph(GlyphTable.java:191)
      - locked <0x00000002d218ca28> (a org.apache.fontbox.ttf.RAFDataStream)
      at org.apache.fontbox.ttf.TrueTypeFont.getPath(TrueTypeFont.java:676)
      at org.apache.pdfbox.pdmodel.font.PDType1Font.getPath(PDType1Font.java:638)
      at org.apache.pdfbox.rendering.Type1Glyph2D.getPathForCharacterCode(Type1Glyph2D.java:83)
      at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:495)
      at org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:476)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:787)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:805)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:743)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:606)
      at org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:933)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
      at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:277)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:347)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:268)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:228)
      at xxxxxxx.export.service.thumbnail.PDFSlideGeneratorServiceImpl$1.call(PDFSlideGeneratorServiceImpl.java:60)
      at xxxxxxx.ops.executor.util.ParallelExecutorTask.doCall(ParallelExecutorTask.java:43)
      at xxxxxxx.ops.executor.util.ParallelExecutor.executeTaskFromQueue(ParallelExecutor.java:154)
      at xxxxxxx.ops.executor.util.ParallelExecutor.access$100(ParallelExecutor.java:26)
      at xxxxxxx.ops.executor.util.ParallelExecutor$WorkerTask.doCall(ParallelExecutor.java:164)
      at xxxxxxx.ops.executor.util.UserContextAwareCallable.call(UserContextAwareCallable.java:89)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      
      
      
      APP_Thread_50408_759_100162222_WorkerTask_1652842343227_P_Th_SPR-APP-pool-5-thread-5
      PRIORITY : 5
      THREAD ID : 0X00007F894C404800
      NATIVE ID : 0X44D0
      NATIVE ID (DECIMAL) : 17616
      STATE : BLOCKED
      stackTrace:
      java.lang.Thread.State: BLOCKED (on object monitor)
      at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:356)
      - waiting to lock <0x00000002d218ca28> (a org.apache.fontbox.ttf.RAFDataStream)
      at org.apache.fontbox.ttf.TrueTypeFont.getTable(TrueTypeFont.java:150)
      - locked <0x00000002d216fec8> (a org.apache.fontbox.ttf.TrueTypeFont)
      at org.apache.fontbox.ttf.TrueTypeFont.getCmap(TrueTypeFont.java:262)
      at org.apache.fontbox.ttf.TrueTypeFont.getUnicodeCmapImpl(TrueTypeFont.java:556)
      at org.apache.fontbox.ttf.TrueTypeFont.getUnicodeCmapLookup(TrueTypeFont.java:541)
      at org.apache.fontbox.ttf.TrueTypeFont.nameToGID(TrueTypeFont.java:629)
      at org.apache.fontbox.ttf.TrueTypeFont.hasGlyph(TrueTypeFont.java:698)
      at org.apache.pdfbox.pdmodel.font.PDType1Font.getNameInFont(PDType1Font.java:601)
      at org.apache.pdfbox.pdmodel.font.PDType1Font.hasGlyph(PDType1Font.java:645)
      at org.apache.pdfbox.rendering.Type1Glyph2D.getPathForCharacterCode(Type1Glyph2D.java:59)
      at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:495)
      at org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:476)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:787)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:805)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:743)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:606)
      at org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:56)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:933)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
      at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
      at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:277)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:347)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:268)
      at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:228)
      at xxxxxxx.export.service.thumbnail.PDFSlideGeneratorServiceImpl$1.call(PDFSlideGeneratorServiceImpl.java:60)
      at xxxxxxx.ops.executor.util.ParallelExecutorTask.doCall(ParallelExecutorTask.java:43)
      at xxxxxxx.ops.executor.util.ParallelExecutor.executeTaskFromQueue(ParallelExecutor.java:154)
      at xxxxxxx.ops.executor.util.ParallelExecutor.access$100(ParallelExecutor.java:26)
      at xxxxxxx.ops.executor.util.ParallelExecutor$WorkerTask.doCall(ParallelExecutor.java:164)
      at xxxxxxx.ops.executor.util.UserContextAwareCallable.call(UserContextAwareCallable.java:89)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748) 

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Ram Lakshmanan Ram Lakshmanan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: