Сканирование Fortify зависает при переводе файла - PullRequest
0 голосов
/ 05 декабря 2018

Я пытаюсь запустить сканирование с использованием плагина maven.Вот моя конфигурация

<plugin>
    <groupId>com.fortify.ps.maven.plugin</groupId>
    <artifactId>sca-maven-plugin</artifactId>
    <version>4.20</version>
    <configuration>
        <toplevelArtifactId>bmss</toplevelArtifactId>
        <buildId>bmss</buildId>
        <source>${java.version}</source>
        <htmlReport>true</htmlReport>
        <maxHeap>4g</maxHeap>
        <stackSize>4m</stackSize>
        <jre64>true</jre64>
        <verbose>true</verbose>
        <skipTests>true</skipTests>
    </configuration>
</plugin>

И я запускаю эти команды:

mvn clean package -DskipTests
mvn sca:clean
mvn sca:translate
mvn sca:scan

Он успешно перевел несколько модулей в многомодульный проект maven и просто завис на одном из классов.

Эта команда фактически выполняет:

cmd: "/bin/sh -c sourceanalyzer -64 -Xmx4g -Xss4m @/home/mx01349/BuildAgent2/work/3ae5c4d240c4124f/bmss-facade/target/sca-translate-java.txt"  

Вот стек основного процесса:

"sourceanalyzer" prio=10 tid=0x00007f8a30512800 nid=0x3923a7 runnable [0x00007f8a2219c000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.System.identityHashCode(Native Method)
        at java.util.IdentityHashMap.hash(Unknown Source)
        at java.util.IdentityHashMap.containsKey(Unknown Source)
        at com.fortify.frontend.translator.java.TypeSystem$Type.hashCode(TypeSystem.java:867)
        at com.fortify.frontend.translator.java.TypeSystem$Type.hashCode(TypeSystem.java:893)
        at java.util.HashMap.hash(Unknown Source)
        at java.util.HashMap.put(Unknown Source)
        at com.fortify.frontend.translator.java.TypeSystem$Utils.createGenericInstantiation(TypeSystem.java:2442)
        at com.fortify.frontend.translator.java.TypeSystem$Utils.createGenericInstantiation(TypeSystem.java:2451)
        at com.fortify.frontend.translator.java.TypeSystem$Utils.instantiateFunction(TypeSystem.java:2499)
        at com.fortify.frontend.translator.java.TypeSystem$Utils.findFunctionalMethod(TypeSystem.java:2542)
        at com.fortify.frontend.translator.java.TypeSystem$Utils.getFunctionalMethod(TypeSystem.java:2619)
        at com.fortify.frontend.translator.java.TypeInference.findInferenceParameters(TypeInference.java:2890)
        at com.fortify.frontend.translator.java.TypeInference.findInputVariables(TypeInference.java:2966)
        at com.fortify.frontend.translator.java.TypeInference.computeInputOutput(TypeInference.java:2821)
        at com.fortify.frontend.translator.java.TypeInference.chooseSafeConstraints(TypeInference.java:2857)
        at com.fortify.frontend.translator.java.TypeInference.reduceAdditionalConstraints(TypeInference.java:3010)
        at com.fortify.frontend.translator.java.TypeInference.invocationType(TypeInference.java:3115)
        at com.fortify.frontend.translator.java.JavaResolver$ResolvingVisitor.inferInvocationType(JavaResolver.java:6070)
        at com.fortify.frontend.translator.java.JavaResolver$ResolvingVisitor.inferInvocationType(JavaResolver.java:6095)
        at com.fortify.frontend.translator.java.JavaResolver$ResolvingVisitor.getFunctionType(JavaResolver.java:6145)
        at com.fortify.frontend.translator.java.JavaResolver$ResolvingVisitor.getFunctionType(JavaResolver.java:6162)
        at com.fortify.frontend.translator.java.JavaResolver$ResolvingVisitor.getTargetType(JavaResolver.java:6010)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.typeOfInterface(JavaResolver.java:6908)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.visit(JavaResolver.java:6963)
        at com.fortify.frontend.translator.nodes.STFunctionReference.accept(STFunctionReference.java:93)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:108)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.visit(JavaResolver.java:6401)
        at com.fortify.frontend.translator.nodes.STFunCall.accept(STFunCall.java:393)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:108)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.visit(JavaResolver.java:6401)
        at com.fortify.frontend.translator.nodes.STFunCall.accept(STFunCall.java:393)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:54)
        at com.fortify.frontend.translator.nodes.STAssignmentStmt.accept(STAssignmentStmt.java:123)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:59)
        at com.fortify.frontend.translator.nodes.STBlock.accept(STBlock.java:267)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:113)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.visit(JavaResolver.java:6368)
        at com.fortify.frontend.translator.nodes.STFunDecl.accept(STFunDecl.java:316)
        at com.fortify.frontend.translator.nodes.STNode.childrenAccept(STNode.java:730)
        at com.fortify.frontend.nst.STVisitorAdapter.defaultVisit(STVisitorAdapter.java:27)
        at com.fortify.frontend.nst.STVisitorAdapter.visit(STVisitorAdapter.java:69)
        at com.fortify.frontend.translator.java.JavaResolver$FunctionReferenceRewriter.visit(JavaResolver.java:6361)
        at com.fortify.frontend.translator.nodes.STClassDecl.accept(STClassDecl.java:383)
        at com.fortify.frontend.translator.java.JavaResolver.resolve(JavaResolver.java:385)
        at com.fortify.sca.frontend.FrontEnd.resolve(FrontEnd.java:384)
        at com.fortify.sca.frontend.FrontEnd.resolve(FrontEnd.java:353)
        at com.fortify.sca.frontend.JavaFrontEnd.resolve(JavaFrontEnd.java:405)
        at com.fortify.sca.frontend.FrontEnd.runParseTranslateResolve(FrontEnd.java:343)
        at com.fortify.sca.frontend.JavaFrontEnd.translateJavaFiles(JavaFrontEnd.java:208)
        at com.fortify.sca.frontend.JavaFrontEnd.runTranslator(JavaFrontEnd.java:128)
        at com.fortify.sca.frontend.FrontEndSession.runSingleFrontEnd(FrontEndSession.java:238)
        at com.fortify.sca.frontend.FrontEndSession.runFrontEnd(FrontEndSession.java:130)
        at com.fortify.sca.Main$Sourceanalyzer.runSourceanalyzer(Main.java:614)
        at com.fortify.sca.Main$Sourceanalyzer.run(Main.java:489)

Какие могут быть возможные причины и как я могу это исправить?

...