Menu

#1393 PMD hanging during DataflowAnomalyAnalysis

PMD-5.3.4
closed
None
PMD
2-Critical
Bug
5.3.3
DataflowAnomalyAnalysis
2015-09-18
2015-08-21
Joe Casey
No

Running the java-controversial ruleset, specifically DataflowAnomalyAnalysis on source which has nested conditionals, loops, and sentinel values causes PMD to hang indefinintely or until it throws an OutOfMemoryException.

The last line of debugging output is:
Processing continueBreakReturnStack elements
Starting continueBreakReturnStack processing loop
ENTRY
RETURN
Completed continueBreakReturnStack processing loop
RETURN
Could not find class <class>, due to: java.lang.ClassNotFoundException: <class>

Then the PMD process will just hang until forcibly terminated.

I created a contrivied example source file (LoopTest.java; attached) which causes the halting. I've also attached the debug output (pmd.out) of running the command:

pmd.bat -f xml -R java-controversial -D -d LoopTest.java -r ec2test.out

Removing a loop, conditional, or sentinel assignment will result in PMD exiting cleanly. So my guess is that the complex structure of the looping and branching is causing problems for DataflowAnomalyAnalysis.

2 Attachments

Discussion

  • Joe Casey

    Joe Casey - 2015-08-21

    I forgot to note that I created a custom ruleset which excluded DataflowAnomalyAnalysis, and PMD exits cleanly when using it.

    <ruleset name="controversial-sans-dataflow" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> <description>Java Controversial ruleset without DataflowAnomalyAnalysis</description> <rule ref="rulesets/java/controversial.xml"> <exclude name="DataflowAnomalyAnalysis"/> </rule> </ruleset>

    The debug output is the list of loaded rules, "Processing <file>", and then the error "Could not find class <class>...".

     
  • Andreas Dangel

    Andreas Dangel - 2015-09-18
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.4
     

Log in to post a comment.