Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NullPointerException and IllegalThreadStateException when repeatedly connecting #1493

Open
fantostisch opened this issue Jun 3, 2022 · 3 comments

Comments

@fantostisch
Copy link

General information

  1. Android Version: 11
  2. Android Vendor/Custom ROM: OnePlus OxygenOS
  3. Device: OnePlus 9 Pro
  4. Version of the app (version number/play store version/self-built):
    Bug seems to occur in F-Droid version v0.7.37, but not in v.0.7.29. After testing different versions, it seems that the bug is introduced in 3a674d3

Description of the issue

When repeatedly and quickly pressing an OpenVPN shortcut and immediately pressing the back button on the device to close the OpenVPN log, OpenVPN crashes.
The same crashes occur when repeatedly pressing the connect/disconnect toggle in the latest version of the eduVPN Android app.

Log

Different crashes occur:

java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Thread.start()' on a null object reference
	at de.blinkt.openvpn.core.OpenVPNService.startOpenVPN(OpenVPNService.java:638)
	at de.blinkt.openvpn.core.OpenVPNService.lambda$onStartCommand$1$de-blinkt-openvpn-core-OpenVPNService(OpenVPNService.java:528)
	at de.blinkt.openvpn.core.OpenVPNService$$ExternalSyntheticLambda0.run(Unknown Source:6)
	at java.lang.Thread.run(Thread.java:923)
java.lang.IllegalThreadStateException
	at java.lang.Thread.start(Thread.java:872)
	at de.blinkt.openvpn.core.OpenVPNService.startOpenVPN(OpenVPNService.java:638)
	at de.blinkt.openvpn.core.OpenVPNService.lambda$onStartCommand$1$de-blinkt-openvpn-core-OpenVPNService(OpenVPNService.java:528)
	at de.blinkt.openvpn.core.OpenVPNService$$ExternalSyntheticLambda0.run(Unknown Source:6)
	at java.lang.Thread.run(Thread.java:923)
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Thread.start()' on a null object reference
	at de.blinkt.openvpn.core.OpenVPNService.startOpenVPN(OpenVPNService.java:638)
	at de.blinkt.openvpn.core.OpenVPNService.lambda$onStartCommand$1$de-blinkt-openvpn-core-OpenVPNService(OpenVPNService.java:528)
	at de.blinkt.openvpn.core.OpenVPNService$$ExternalSyntheticLambda0.run(Unknown Source:6)
	at java.lang.Thread.run(Thread.java:923)
java.lang.NullPointerException: Attempt to invoke virtual method 'void de.blinkt.openvpn.core.DeviceStateReceiver.networkStateChange(android.content.Context)' on a null object reference
	at de.blinkt.openvpn.core.OpenVPNService.registerDeviceStateReceiver(OpenVPNService.java:451)
	at de.blinkt.openvpn.core.OpenVPNService.lambda$startOpenVPN$2$de-blinkt-openvpn-core-OpenVPNService(OpenVPNService.java:659)
	at de.blinkt.openvpn.core.OpenVPNService$$ExternalSyntheticLambda1.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:233)
	at android.app.ActivityThread.main(ActivityThread.java:8035)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
@fantostisch
Copy link
Author

Video showing the error:

recording.mp4

@fantostisch
Copy link
Author

A normal user might not do such actions to trigger this error, but the IllegalThreadStateException and NullPointerException seem to show up in the crashes in the Play Store of the eduVPN app, so I think there should be other ways to trigger the issue.

@schwabe
Copy link
Owner

schwabe commented Jul 22, 2022

Are you sure those stacktraces are from 0.7.37? I am looking at OpenVPNService.java:638 but that is only a closing bracket of a function and the OpenVPNService.java:659 is just a synchronized (mProcessLock) and OpenVPNService.java:451 which the stacktrace puts into registerDeviceStateReceiver is actually in unregisterDeviceStateReceiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants