botsing
botsing copied to clipboard
NullPointerException when the target instruction is not found
Characteristics
- Issue Type: bug
- Reproducibility: always
- Severity: crash
- Tool/Service/Component: botsing-reproduction-1.0.4
- Execution Environment: macOS 10.14.2
- Reporter: [email protected]
Description
When the frame in the input stack trace does not correspond to any instruction in the source code (which can happen e.g. when trying to reproduce the stack trace with an incorrect version of the program), Botsing crashes with NullPointerException
:
Exception in thread "main" java.lang.NullPointerException
at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.getPublicCalls(GuidedSearchUtility.java:79)
at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.getPublicCalls(GuidedSearchUtility.java:116)
at eu.stamp.botsing.fitnessfunction.testcase.factories.RootMethodTestChromosomeFactory.fillPublicCalls(RootMethodTestChromosomeFactory.java:197)
at eu.stamp.botsing.fitnessfunction.testcase.factories.RootMethodTestChromosomeFactory.reset(RootMethodTestChromosomeFactory.java:191)
at eu.stamp.botsing.fitnessfunction.testcase.factories.RootMethodTestChromosomeFactory.<init>(RootMethodTestChromosomeFactory.java:60)
at eu.stamp.botsing.testgeneration.strategy.BotsingIndividualStrategy.getChromosomeFactory(BotsingIndividualStrategy.java:124)
at eu.stamp.botsing.testgeneration.strategy.BotsingIndividualStrategy.getGA(BotsingIndividualStrategy.java:117)
at eu.stamp.botsing.testgeneration.strategy.BotsingIndividualStrategy.generateTests(BotsingIndividualStrategy.java:69)
at eu.stamp.botsing.reproduction.CrashReproduction.generateCrashReproductionTests(CrashReproduction.java:131)
at eu.stamp.botsing.reproduction.CrashReproduction.execute(CrashReproduction.java:80)
at eu.stamp.botsing.Botsing.parseCommandLine(Botsing.java:78)
at eu.stamp.botsing.Botsing.main(Botsing.java:163)
Steps to reproduce
- Download and compile the source code provided at LOG-47957
- Save the provided stack trace as
LOG-47957.txt
, replace log4jb with log4j - Run
java -jar botsing-reproduction-1.0.4.jar -crash_log LOG-47957.txt -target_frame 1 -project_cp logging-log4j-1.2.14/dist/lib
This issue occurred to me several times too. https://github.com/STAMP-project/evocrash-usecases-output/blob/master/Activeeon/Botsing/v1.0.4/programming/illegalArgumentException/illegalArgumentException1Result.txt
When the frame in the input stack trace does not correspond to any instruction in the source code (which can happen e.g. when trying to reproduce the stack trace with an incorrect version of the program), Botsing crashes with
NullPointerException
:
The given software under test bytecode should be the same as the version on which the given stack trace has been thrown. Otherwise, it does not make sense to apply Botsing on them because the achieved stack trace by the generated test cases of Botsing will never be the same as the given one.