You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2014/10/21 02:03:10 UTC

[jira] [Commented] (PDFBOX-2439) ArrayIndexOutOfBoundsException in multithreaded system

    [ https://issues.apache.org/jira/browse/PDFBOX-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14177681#comment-14177681 ] 

John Hewson commented on PDFBOX-2439:
-------------------------------------

FontBox's font classes are required to be thread safe, because in PDFBox we cache system fonts statically. This looks like a thread safety bug somewhere in FontBox's TTF handling, presumably near the top of your stack trace.

> ArrayIndexOutOfBoundsException in multithreaded system
> ------------------------------------------------------
>
>                 Key: PDFBOX-2439
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2439
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>             Fix For: 2.0.0
>
>         Attachments: TestPDFBox.java
>
>
> When it loads replacement font from OS i sometimes get:
> Exception in thread "Thread-27" java.lang.ArrayIndexOutOfBoundsException: 40036
> 	at org.apache.fontbox.ttf.GlyfSimpleDescript.readFlags(GlyfSimpleDescript.java:197)
> 	at org.apache.fontbox.ttf.GlyfSimpleDescript.<init>(GlyfSimpleDescript.java:78)
> 	at org.apache.fontbox.ttf.GlyphData.initData(GlyphData.java:58)
> 	at org.apache.fontbox.ttf.GlyphTable.getGlyph(GlyphTable.java:161)
> 	at org.apache.pdfbox.rendering.font.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:140)
> 	at org.apache.pdfbox.rendering.font.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:92)
> 	at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:392)
> 	at org.apache.pdfbox.rendering.PageDrawer.showGlyph(PageDrawer.java:372)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:411)
> 	at org.apache.pdfbox.rendering.PageDrawer.showText(PageDrawer.java:346)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.showTextStrings(PDFStreamEngine.java:322)
> 	at org.apache.pdfbox.contentstream.operator.text.ShowTextAdjusted.process(ShowTextAdjusted.java:38)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:482)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processSubStream(PDFStreamEngine.java:236)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processSubStream(PDFStreamEngine.java:201)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:155)
> 	at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:177)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
> 	at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:109)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)