botsing icon indicating copy to clipboard operation
botsing copied to clipboard

NullPointerException when the target instruction is not found

Open MattSkala opened this issue 5 years ago • 2 comments

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

  1. Download and compile the source code provided at LOG-47957
  2. Save the provided stack trace as LOG-47957.txt, replace log4jb with log4j
  3. 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

MattSkala avatar Apr 17 '19 13:04 MattSkala

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

MaelAudren avatar May 03 '19 09:05 MaelAudren

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.

pderakhshanfar avatar Oct 03 '19 14:10 pderakhshanfar