AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

Fatal error: "Too many nested function calls. May be due to infinite recursion" #106

Closed RoxvilleRooster closed 4 years ago

RoxvilleRooster commented 4 years ago

Hello, Makita-san,

I am testing the pdf5-ml transformation. I have encountered this fatal error.

  [xslt] C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\xsl\dita2fo_attribute.xsl:87:24: Fatal Error! Too many nested function calls. May be due to infinite recursion
     [xslt] Failed to process C:\algodocs\temp\dita-ot-testing\AWA_oasisbook_CONVERTED.xml
Error: The following error occurred while executing this line:
C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\build.xml:193: The following error occurred while executing this line:
C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\build_transform.xml:39: The following error occurred while executing this line:
C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\build_transform.xml:70: The following error occurred while executing this line:
C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\build_transform.xml:83: The following error occurred while executing this line:
C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\build_transform.xml:95: Fatal error during transformation using C:\DITA-OT\dita-ot-3.3.4\plugins\com.antennahouse.pdf5.ml\xsl\dita2fo_shell.xsl: Too many nested function calls. May be due to infinite recursion; SystemID: file:/C:/DITA-OT/dita-ot-3.3.4/plugins/com.antennahouse.pdf5.ml/xsl/dita2fo_attribute.xsl; Line#: 87; Column#: 24
Build step 'Execute Windows batch command' marked build as failure
Archiving artifacts
Checking console output
[Slack Notifications] found #9 as previous completed, non-aborted build
Finished: FAILURE

This same map builds successfully when I build using other transform: "DITA Map PDF - based on HTML5 & CSS" in Oxygen Author 21.1. I needed to bump up the Java heap size to -Xmx4096m to get a result but the PDF rendered successfully. In this case the CSS Processor was Oxygen PDF Chemistry. I was not testing the use of the Antenna House CCS Processor in this case. I was really just looking to see if I could generate a PDF of this same boo with another OT PDF transform.

So I expect this indicates a defect in pdf5.ml. I have tried boosting the Java heap space to -Xmx4086m but to no avail yet.

consoleText.txt

RoxvilleRooster commented 4 years ago

I boosted the ANT_OPTS to -Xmx8192m but that had no affect on the result of the pdf5-ml transformation.

ToshihikoMakita commented 4 years ago

I have no experience to got this error in ahf:getClearAtts (dita2fo_attribute.xsl Line#: 87) until now. Is it possible to send me the test data you are using?

ToshihikoMakita commented 4 years ago

Please try -Xss parameter. You can increase stack size by this parameter.

RoxvilleRooster commented 4 years ago

Setting the -Xss made no real difference. It seems that the looping behavior, where the transformation looked for the dlentry element's title content, would run endlessly. After 30 mins, my process timed out (that was my setting in Jenkins) - the builds did not end before that.

But, after inspecting the two DITA files mentioned in the console log, I manually changed the DITA .

Here are the log entries that directed me:

     [xslt] [getXrefTitle 035W] Xref/@href destination dlentry has no title content. dlentry id=obligor file=file:/C:/algodocs/svn/projects/algo_aggregation/awa/FRTBAggregation_input_data_portfolio.dita
     [xslt] [getXrefTitle 035W] Xref/@href destination dlentry has no title content. dlentry id=underlyings file=file:/C:/algodocs/svn/projects/algo_aggregation/awa/FRTBAggregation_input_data_context_data.dita

In this case, the DITA was valid but I'd suggest that our usage was suboptimal. I really do not think that it is a great idea to have an xref to a dlentry but it is valid and we were doing this. The xref pointed to an id of a dlentry element like this:

<xref href="FRTBAggregation_input_data_context_data.dita#input_files_context_data/instruments"/>

Once I added link titles in xref elements, the pdf5.ml transformation progressed.

<xref href="FRTBAggregation_input_data_context_data.dita#input_files_context_data/instruments">Instruments.csv</xref>

Makita-san, I'd suggest that this case could be a known issue or, better yet, a defect that you might address in the future.

ToshihikoMakita commented 4 years ago

I'd suggest that this case could be a known issue or, better yet, a defect that you might address in the future.

Recently another user requested me to enable xref links to dlentry. In this case the build process ended normally. Based on your suggestion, I will investigate this problem as soon as possible.

ToshihikoMakita commented 4 years ago

I have done several test cases for referencing dlentry from xref. But I couldn't reproduce the looping. Could you kindly offer the relevant contents referenced by "FRTBAggregation_input_data_context_data.dita#input_files_context_data/instruments"?

achall36 commented 4 years ago

Since the DITA has been changed, I cannot reproduce the looping either. Let's close this and, if I see this looping again, we can re-open this and I will attach files. I can create an xref to a dlentry and that works fine in the pd5.ml transform.