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

Henning Bermeyer commented on PDFBOX-1835:
------------------------------------------

Please continue investigating on this, since I have the same problem with 
PDFBox 1.8.3. 
I'm afraid I am not allowed to add an actual PDF for the same reasons as Johnny 
Minty. But I can add another stack trace.

{code}
Caused by: java.lang.StackOverflowError
        at org.apache.pdfbox.cos.COSObject.toString(COSObject.java:159)
        at java.lang.String.valueOf(String.java:2854)
        at java.lang.StringBuilder.append(StringBuilder.java:128)
        at java.util.AbstractCollection.toString(AbstractCollection.java:450)
        at java.lang.String.valueOf(String.java:2854)
        at java.lang.StringBuilder.append(StringBuilder.java:128)
        at org.apache.pdfbox.cos.COSArray.toString(COSArray.java:417)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
        at org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
...
{code}

I wonder under which circumstances the data structure of a PDF may result in 
reference loops in dictionaries, so the String serialization runs into endless 
recursion.

> Stackoverflow pdfbox 1.8.3
> --------------------------
>
>                 Key: PDFBOX-1835
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1835
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.3
>         Environment: CentOS6
> Java 7
>            Reporter: Johnny Minty
>
> I guys I'm using Apache Tika in an application which uses PDFbox for PDF 
> parsing.
> When trying to read in a specific PDF attachment i'm receiving the following 
> stack overflow:
> Caused by: java.lang.StackOverflowError
>         at java.lang.String.valueOf(String.java:2854)
>         at java.lang.StringBuilder.append(StringBuilder.java:128)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1450)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)
>         at 
> org.apache.pdfbox.cos.COSDictionary.toString(COSDictionary.java:1453)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to