ICEpdf
  1. ICEpdf
  2. PDF-592

Fatal error parsing PDF file stream. java.util.EmptyStackException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.1
    • Fix Version/s: 5.0.2
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      Pro, JAI, -Xmx512m
    • Salesforce Case Reference:

      Description

      If memory isn't allocated, the test PDF will run out of java heap memory. I've added 512mb which does seem to help but eventually the sample PDF viewer will crash with the following:

      WARNING: Fatal error parsing PDF file stream.
      java.util.EmptyStackException
      at java.util.Stack.peek(Stack.java:85)
      at java.util.Stack.pop(Stack.java:67)
      at org.icepdf.core.util.Parser.getObject(Parser.java:143)
      at org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
      at org.icepdf.core.util.Library.getObject(Library.java:123)
      at org.icepdf.core.pobjects.PageTree.getPageOrPagesPotentiallyNotInitedFromRefe
      renceAt(PageTree.java:238)
      at org.icepdf.core.pobjects.PageTree.getPagePotentiallyNotInitedByRecursiveInde
      x(PageTree.java:257)
      at org.icepdf.core.pobjects.PageTree.getPage(PageTree.java:326)
      at org.icepdf.core.pobjects.Document.getPageText(Document.java:1119)
      at test.IcePdfCrashTest.callPageText(IcePdfCrashTest.java:38)
      at test.IcePdfCrashTest.main(IcePdfCrashTest.java:24)
      java.util.EmptyStackException
      at java.util.Stack.peek(Stack.java:85)
      at java.util.Stack.pop(Stack.java:67)
      at org.icepdf.core.util.Parser.getObject(Parser.java:143)
      at org.icepdf.core.util.LazyObjectLoader.loadObject(LazyObjectLoader.java:73)
      at org.icepdf.core.util.Library.getObject(Library.java:123)
      at org.icepdf.core.pobjects.PageTree.getPageOrPagesPotentiallyNotInitedFromRefe
      renceAt(PageTree.java:238)
      at org.icepdf.core.pobjects.PageTree.getPagePotentiallyNotInitedByRecursiveInde
      x(PageTree.java:257)
      at org.icepdf.core.pobjects.PageTree.getPage(PageTree.java:326)
      at org.icepdf.core.pobjects.Document.getPageText(Document.java:1119)
      at test.IcePdfCrashTest.callPageText(IcePdfCrashTest.java:38)
      at test.IcePdfCrashTest.main(IcePdfCrashTest.java:24)
      May 30, 2013 4:33:55 PM org.icepdf.core.util.Parser getObject

      Is this simply a case of needing more memory? The PDF is 300mb+.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35865 Tue Jun 04 12:49:49 MDT 2013 patrick.corless PDF-592 fixed explicit casting issues from integers to float related to getNumber() parser changes.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35853 Tue Jun 04 10:34:26 MDT 2013 patrick.corless PDF-592 fixed an overflow issue when parsing really large numbers.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35681 Fri May 31 14:40:23 MDT 2013 patrick.corless PDF-592 fixed explicit casting issues from integers to float related to getNumber() parser changes.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/annotations/TextMarkupAnnotation.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/annotations/LineAnnotation.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType2Pattern.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/annotations/InkAnnotation.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/ShadingType1Pattern.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35677 Fri May 31 11:17:47 MDT 2013 patrick.corless PDF-592 reworked getNumber to keep integers as integers so that precision isn't lost on a cast to (float)
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/util/Parser.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35674 Fri May 31 09:45:32 MDT 2013 patrick.corless PDF-592 fixed an overflow issue when parsing really large numbers.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/Parser.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #35673 Fri May 31 09:45:04 MDT 2013 patrick.corless PDF-592 fixed an overflow issue when parsing really large numbers.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/util/Parser.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved: