FOP
  1. FOP
  2. FOP-1178

fop dies due to integer overflow

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.92
    • Fix Version/s: None
    • Component/s: layout/unqualified
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      39414

      Description

      TextLayoutManager.java rev=392488
      has
      private short iTempStart = 0; (Line 145)
      which it uses in a loop at line 602:
      for (; iTempStart < textArray.length
      && !isSpace(textArray[iTempStart])
      && textArray[iTempStart] != NEWLINE
      && !(iTempStart > iNextStart
      && isBreakChar(textArray[iTempStart - 1]));
      iTempStart++) {
      ...
      Looks like in my case textArray was big enough so that length > 32767

      I am using fop-0.92beta
      Here is the command line:
      fop -fo PSC_PTL_Compiler_Design_Spec.fo -pdf PSC_PTL_Compiler_Design_Spec.pdf

      and the output:
      Apr 26, 2006 12:50:17 PM org.apache.fop.cli.Main startFOP
      SEVERE: Exception
      java.lang.ArrayIndexOutOfBoundsException: -32768
      at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:167)
      at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)
      at org.apache.fop.cli.Main.startFOP(Main.java:159)
      at org.apache.fop.cli.Main.main(Main.java:190)

      ---------

      java.lang.ArrayIndexOutOfBoundsException: -32768
      at
      org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:605)
      at
      org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:647)
      at
      org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:582)
      at
      org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:275)
      at
      org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
      at
      org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:275)
      at
      org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
      at
      org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:275)
      at
      org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
      at
      org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:275)
      at
      org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105)
      at
      org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:98)
      at
      org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements(PageSequenceLayoutManager.java:234)
      at
      org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:502)
      at
      org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList(PageSequenceLayoutManager.java:226)
      at
      org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:252)
      at
      org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:220)
      at
      org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:152)
      at
      org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:320)
      at
      org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:147)
      at
      org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:357)
      at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:193)
      at
      org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at
      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
      Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at
      org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
      at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:164)
      at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)
      at org.apache.fop.cli.Main.startFOP(Main.java:159)
      at org.apache.fop.cli.Main.main(Main.java:190)

      1. fop_39414.fo
        62 kB
        Pavel Zeldin

        Activity

        Pavel Zeldin created issue -
        Hide
        Jeremias Maerki added a comment -

        Please attach an FO file so we can reproduce the bug. Thanks.

        Show
        Jeremias Maerki added a comment - Please attach an FO file so we can reproduce the bug. Thanks.
        Hide
        Manuel Mall added a comment -

        Easy to reproduce:

        <block white-space="pre"><![CDATA[
        put any text in here having more then 32768 characters
        ]]></block>

        Show
        Manuel Mall added a comment - Easy to reproduce: <block white-space="pre"><![CDATA[ put any text in here having more then 32768 characters ]]></block>
        Hide
        Pavel Zeldin added a comment -

        Attachment fop_39414.fo has been added with description: example fo file to reproduce the problem

        Show
        Pavel Zeldin added a comment - Attachment fop_39414.fo has been added with description: example fo file to reproduce the problem
        Hide
        Andreas L. Delmelle added a comment -

        Fixed in FOP Trunk.

        Show
        Andreas L. Delmelle added a comment - Fixed in FOP Trunk.
        Hide
        Andreas L. Delmelle added a comment -
        Show
        Andreas L. Delmelle added a comment - Sorry, forgot to add: URL: http://svn.apache.org/viewvc?rev=439511&view=rev
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Pavel Zeldin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development