nousheen-n / androboinc

Automatically exported from code.google.com/p/androboinc
0 stars 0 forks source link

Crash while connecting #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Error reported at Google Play:

v6.10.58.rc1
Sep 8, 2012 6:11:30 AM
2 reports

java.lang.NullPointerException
at 
sk.boinc.androboinc.bridge.ClientBridgeWorkerHandler.connect(ClientBridgeWorkerH
andler.java:163)
at 
sk.boinc.androboinc.bridge.ClientBridgeWorkerThread$2.run(ClientBridgeWorkerThre
ad.java:106)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at 
sk.boinc.androboinc.bridge.ClientBridgeWorkerThread.run(ClientBridgeWorkerThread
.java:77)

What steps will reproduce the problem?
1. Add the host which is protected by password, but do not setup any password 
in AndroBOINC
2. Try to connect -> application crashes

Analysis:
The code statement generating exception is:
mGpuPresent = (boincHostInfo.g_ngpus > 0);
The boincHostInfo is null because of previous statement:
edu.berkeley.boinc.lite.HostInfo boincHostInfo = mRpcClient.getHostInfo();
The null value could be returned on decoding errors or if connection is closed.
The failure at this stage means the connection is unusable.

Possible solutions:
a) Quick fix, not perfect: simply test the result of getHostInfo() for null.
b) Better fix, but needs some code rework: Use exception(s) to distinguish 
between connection failure and formatting errors. It should apply to all 
RpcClient calls after connection is successfully open. The exception mechanism 
can also be used to notify user about connection drop in the dialog with 
possible reconnect offer (such notification is not done currently, but it is 
planned for future).

Original issue reported on code.google.com by pavol.michalec@gmail.com on 9 Sep 2012 at 6:32

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r64.

Original comment by pavol.michalec@gmail.com on 16 Sep 2012 at 8:27

GoogleCodeExporter commented 8 years ago
Verified on published version 6.10.58.rc3

Original comment by pavol.michalec@gmail.com on 18 Sep 2012 at 2:29