secure-software-engineering / FlowDroid

FlowDroid Static Data Flow Tracker
GNU Lesser General Public License v2.1
1.02k stars 293 forks source link

NPE in propagateNormalFlow #572

Closed aoli-al closed 1 year ago

aoli-al commented 1 year ago

Hi,

I'm trying to use FlowDroid to analyze mapreduce and but I got the following NPEs:

Exception in thread "FlowDroid" java.lang.NullPointerException: Cannot invoke "soot.jimple.infoflow.aliasing.Aliasing.mustAlias(soot.Local, soot.Local, soot.jimple.Stmt)" because the return value of "soot.jimple.infoflow.probl
ems.rules.forward.StrongUpdatePropagationRule.getAliasing()" is null                                                                                                                                                              
        at soot.jimple.infoflow.problems.rules.forward.StrongUpdatePropagationRule.propagateNormalFlow(StrongUpdatePropagationRule.java:78)                                                                                       
        at soot.jimple.infoflow.problems.rules.PropagationRuleManager.applyNormalFlowFunction(PropagationRuleManager.java:80)                                                                                                     
        at soot.jimple.infoflow.problems.InfoflowProblem$1$1.computeTargetsInternal(InfoflowProblem.java:358)                                                                                                                     
        at soot.jimple.infoflow.problems.InfoflowProblem$1$NotifyingNormalFlowFunction.computeTargets(InfoflowProblem.java:94)                                                                                                    
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.InfoflowSolver.computeNormalFlowFunction(InfoflowSolver.java:89)                                                                                                
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.InfoflowSolver.computeNormalFlowFunction(InfoflowSolver.java:41)                                                                                                
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.FlowInsensitiveSolver.processNormalFlow(FlowInsensitiveSolver.java:558)                                                                                         
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.FlowInsensitiveSolver.processMethod(FlowInsensitiveSolver.java:583)                                                                                             
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.FlowInsensitiveSolver.access$000(FlowInsensitiveSolver.java:65)                                                                                                 
        at soot.jimple.infoflow.solver.fastSolver.flowInsensitive.FlowInsensitiveSolver$PathEdgeProcessingTask.run(FlowInsensitiveSolver.java:745)                                                                                
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)                                                                                                                              
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)                                                                                                                              
        at java.base/java.lang.Thread.run(Thread.java:831) 

I'm using the following configs:

    infoFlow.setSootConfig { options, configs ->
        options.set_allow_phantom_refs(true)
        options.set_prepend_classpath(true)
        options.set_process_dir(libs)
        options.set_output_format(Options.output_format_none)
        options.set_keep_offset(true)
        options.set_keep_line_number(true)
        options.setPhaseOption("jb", "use-original-names:true")
        options.set_ignore_classpath_errors(true)
        options.set_drop_bodies_after_load(false)
        options.set_ignore_resolution_errors(true)
        options.set_ignore_resolving_levels(true)
        configs.memoryThreshold = 0.8
        configs.enableExceptionTracking = false
        configs.enableArrayTracking = false
        configs.flowSensitiveAliasing = false
        configs.staticFieldTrackingMode = StaticFieldTrackingMode.None
        configs.implicitFlowMode = ImplicitFlowMode.NoImplicitFlows
        configs.pathConfiguration.pathReconstructionMode = InfoflowConfiguration.PathReconstructionMode.NoPaths
        configs.solverConfiguration.dataFlowSolver =
            InfoflowConfiguration.DataFlowSolver.FlowInsensitive
        configs.pathConfiguration.pathBuildingAlgorithm =
            InfoflowConfiguration.PathBuildingAlgorithm.ContextInsensitiveSourceFinder
        configs.pathConfiguration.pathReconstructionTimeout = 10 * 60
        configs.aliasingAlgorithm = InfoflowConfiguration.AliasingAlgorithm.None
        configs.solverConfiguration.maxCalleesPerCallSite = 25
        configs.solverConfiguration.maxAbstractionPathLength = 50
        configs.dataFlowTimeout = 1 * 60 * 60
        configs.stopAfterFirstKFlows = 5
        configs.enableExceptionTracking = false
        configs.enableArrayTracking = false
        configs.enableArraySizeTainting = false
    }