{"action":"closed","issue":{"url":"https://api.github.com/repos/integrity-tf/integrity/issues/179","repository_url":"https://api.github.com/repos/integrity-tf/integrity","labels_url":"https://api.github.com/repos/integrity-tf/integrity/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/integrity-tf/integrity/issues/179/comments","events_url":"https://api.github.com/repos/integrity-tf/integrity/issues/179/events","html_url":"https://github.com/integrity-tf/integrity/issues/179","id":298914776,"number":179,"title":"OOMException or TransformerException on huge formatted strings","user":{"login":"S1artie","id":3661818,"avatar_url":"https://avatars2.githubusercontent.com/u/3661818?v=4","gravatar_id":"","url":"https://api.github.com/users/S1artie","html_url":"https://github.com/S1artie","followers_url":"https://api.github.com/users/S1artie/followers","following_url":"https://api.github.com/users/S1artie/following{/other_user}","gists_url":"https://api.github.com/users/S1artie/gists{/gist_id}","starred_url":"https://api.github.com/users/S1artie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/S1artie/subscriptions","organizations_url":"https://api.github.com/users/S1artie/orgs","repos_url":"https://api.github.com/users/S1artie/repos","events_url":"https://api.github.com/users/S1artie/events{/privacy}","received_events_url":"https://api.github.com/users/S1artie/received_events","type":"User","site_admin":false},"labels":[{"id":32904139,"url":"https://api.github.com/repos/integrity-tf/integrity/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/integrity-tf/integrity/milestones/44","html_url":"https://github.com/integrity-tf/integrity/milestone/44","labels_url":"https://api.github.com/repos/integrity-tf/integrity/milestones/44/labels","id":3102616,"number":44,"title":"v0.17.7","description":"","creator":{"login":"S1artie","id":3661818,"avatar_url":"https://avatars2.githubusercontent.com/u/3661818?v=4","gravatar_id":"","url":"https://api.github.com/users/S1artie","html_url":"https://github.com/S1artie","followers_url":"https://api.github.com/users/S1artie/followers","following_url":"https://api.github.com/users/S1artie/following{/other_user}","gists_url":"https://api.github.com/users/S1artie/gists{/gist_id}","starred_url":"https://api.github.com/users/S1artie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/S1artie/subscriptions","organizations_url":"https://api.github.com/users/S1artie/orgs","repos_url":"https://api.github.com/users/S1artie/repos","events_url":"https://api.github.com/users/S1artie/events{/privacy}","received_events_url":"https://api.github.com/users/S1artie/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2018-02-09T12:56:24Z","updated_at":"2018-02-21T10:40:29Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-02-21T10:27:16Z","updated_at":"2018-02-21T10:40:29Z","closed_at":"2018-02-21T10:40:28Z","author_association":"CONTRIBUTOR","body":"It is possible to wreck the XML-to-HTML transformation by creating big (for example 120kb long) formatted strings as part of test result comparisons. This can be the case if large object tree structures are compared.\r\n\r\nThe behavior is like this: the heap will fill up with lots of partial strings, and either you will get an OOM Exception or you will end up with a TransformerException due to too many recursion steps:\r\n```\r\nException in thread \"Integrity XSLT Transform Thread\" java.lang.OutOfMemoryError: GC overhead limit exceeded\r\n15:37:09     at com.icl.saxon.expr.FragmentValue$FragmentEmitter.characters(FragmentValue.java:357)\r\n15:37:09     at com.icl.saxon.output.ProxyEmitter.characters(ProxyEmitter.java:100)\r\n15:37:09     at com.icl.saxon.output.GeneralOutputter.writeContent(GeneralOutputter.java:463)\r\n15:37:09     at com.icl.saxon.output.GeneralOutputter.writeContent(GeneralOutputter.java:444)\r\n```\r\n```\r\nTransforming Integrity Result XML to HTML...Error at xsl:apply-templates on line -1 of :\r\n  Too many nested apply-templates calls\r\n; SystemID: ; Line#: -1; Column#: -1\r\njavax.xml.transform.TransformerException: Too many nested apply-templates calls\r\n    at com.icl.saxon.style.StyleElement.styleError(StyleElement.java:818)\r\n    at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:645)\r\n    at com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGeneralVariable.java:238)\r\n    at com.icl.saxon.style.XSLWithParam.getParamValue(XSLWithParam.java:48)\r\n    at com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:180)\r\n    at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:643)\r\n    at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)\r\n```\r\n\r\nSince transformation happens via XSLT, which does not allow to iteratively parsing an input string, the formatted string to HTML conversion makes heavy use of recursive invocation and string splitting operations. Usually, XSLT transformers perform tail call optimization, which effectively eliminates the nested calls and allows us to recurse without building up a big stack or requiring lots of memory. But the XSLT script contained a situation in which a transformer could not directly recognize the potential for tail call optimization, even though it was there. This currently leads to an explosion in memory requirements and stack depth on larger formatted strings.\r\n\r\nThe situation should be fixed, such that it is easily recognizable for a transformer that it can perform tail call optimization here. Note that it can still be quite CPU intensive to parse huge formatted strings due to lots of string copy operations, but it should no longer crash the transformer at any string size."}}
{"actor":{"display_login":"S1artie"}}