Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NullPointerException and deadlock #94

Open
gibello opened this issue Sep 30, 2019 · 3 comments
Open

NullPointerException and deadlock #94

gibello opened this issue Sep 30, 2019 · 3 comments
Assignees
Labels
botsing This issue is related to botsing core components bug Something isn't working

Comments

@gibello
Copy link

gibello commented Sep 30, 2019

Characteristics

  • Issue Type: bug
  • Reproducibility: always
  • Severity: block
  • Tool/Service/Component: Botsing 1.0.8-SNAPSHOT
  • Execution Environment: Ubuntu Linux 18.04
  • Reporter: Pierre-Yves Gibello, pyg@ow2.org

Description

NullPointerException, and botsing hangs forever (command line).

Steps to reproduce

Joram project (gitlab.ow2.org/joram/joram).

Attached exception trace:
test.txt

To generate classpath, from joram/joram directory:

mvn dependency:copy-dependencies -DoutputDirectory=/tmp/deps

Then run botsing on frame 6:

java -jar botsing-reproduction-1.0.8-SNAPSHOT.jar -project_cp /tmp/deps -crash_log <path_to_exception_trace> -target_frame 6

The following error occurs, and botsing gets stuck forever:

16:11:08.339 [main] INFO  eu.stamp.botsing.StackTrace - Exception type is detected: java.net.ConnectException
16:11:08.345 [main] WARN  eu.stamp.botsing.StackTrace - Missing line in frame 1
16:11:08.350 [main] INFO  eu.stamp.botsing.StackTrace - Target frame is set to: java.net.Socket.connect(Socket:589)
16:11:08.350 [main] INFO  eu.stamp.botsing.StackTrace - Target Class is set to: java.net.Socket
16:11:08.821 [main] INFO  e.s.b.reproduction.CrashReproduction - Starting the dependency analysis. The number of detected jar files is 72.
16:11:25.142 [main] INFO  e.s.b.reproduction.CrashReproduction - Analysing dependencies done!
16:11:25.206 [main] INFO  e.s.b.t.s.BotsingIndividualStrategy - test generation strategy: Botsing individual
Exception in thread "main" java.lang.NullPointerException
	at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.getTargetInstruction(GuidedSearchUtility.java:173)
	at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.getPublicCalls(GuidedSearchUtility.java:77)
	at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.getPublicCalls(GuidedSearchUtility.java:98)
	at eu.stamp.botsing.ga.strategy.operators.GuidedSearchUtility.collectPublicCalls(GuidedSearchUtility.java:30)
	at eu.stamp.botsing.fitnessfunction.testcase.factories.StackTraceChromosomeFactory.fillPublicCalls(StackTraceChromosomeFactory.java:206)
	at eu.stamp.botsing.fitnessfunction.testcase.factories.StackTraceChromosomeFactory.<init>(StackTraceChromosomeFactory.java:70)
	at eu.stamp.botsing.testgeneration.strategy.TestGenerationUtility.getChromosomeFactory(TestGenerationUtility.java:46)
	at eu.stamp.botsing.testgeneration.strategy.TestGenerationUtility.getGA(TestGenerationUtility.java:26)
	at eu.stamp.botsing.testgeneration.strategy.BotsingIndividualStrategy.generateTests(BotsingIndividualStrategy.java:61)
	at eu.stamp.botsing.reproduction.CrashReproduction.generateCrashReproductionTests(CrashReproduction.java:123)
	at eu.stamp.botsing.reproduction.CrashReproduction.execute(CrashReproduction.java:72)
	at eu.stamp.botsing.Botsing.parseCommandLine(Botsing.java:91)
	at eu.stamp.botsing.Botsing.main(Botsing.java:213)
@xdevroey xdevroey added botsing This issue is related to botsing core components bug Something isn't working labels Oct 1, 2019
@pderakhshanfar
Copy link
Collaborator

Hi @gibello,
The given stack trace to Botsing should not contain any frame without a line number. In your trace, the first frame is at java.net.PlainSocketImpl.socketConnect(Native Method). You can remove this frame manually, or you can use the pre-processor, developed by Engineering, to filter the frames without the line number.

@pderakhshanfar pderakhshanfar removed the bug Something isn't working label Oct 3, 2019
@gibello
Copy link
Author

gibello commented Oct 4, 2019

Hi @pderakhshanfar,
I agree. But there should never be a NPE (and a deadlock !).
NPEs are bugs, deadlocks are bugs, whatever happens. And they must be fixed.
An error message would be a good idea: or if not possible, simply end cleanly with no test generated.

@pderakhshanfar
Copy link
Collaborator

@gibello, yes, you are right. In the next release, I will make sure that this exception is handled properly.

@pderakhshanfar pderakhshanfar added the bug Something isn't working label Oct 4, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
botsing This issue is related to botsing core components bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants