creswick / StreamingQR

Apache License 2.0
2 stars 0 forks source link

Crash when returning to the receiver after canceling a 'choose action' #79

Closed creswick closed 10 years ago

creswick commented 10 years ago

We've only seen this once so far (on Don's phone), but this seems to be what happened:

I/mm-camera(  199): gyro_module_stop_session: Exit successful
I/mm-camera(  199): stats_module_stop_session: 3 port =0xb82e1670 name=stats_sink
I/mm-camera(  199): cpp_module_stop_session:453, info: stopping session 1 ...
I/mm-camera(  199): cpp_thread_process_pipe_message:359, CPP_THREAD_MSG_ABORT: cpp_thread exiting..
I/mm-camera(  199): cpp_module_stop_session:495, info: session 1 stopped.
I/mm-camera(  199): c2d_module_stop_session:322, info: stopping session 1 ...
I/mm-camera(  199): c2d_thread_process_pipe_message:503, C2D_THREAD_MSG_ABORT: c2d_thread exiting..
I/mm-camera(  199): c2d_module_stop_session:361, info: session 1 stopped.
I/Camera2Client(  183): Camera 0: Closed
I/Choreographer(11783): Skipped 48 frames!  The application may be doing too much work on its main thread.
I/Camera2ClientBase(  183): Closed Camera 0
D/qrstream(11783): DisplayUpdate.handleMessage, draw_qr_points
D/qrstream(11783): draw_qr_points: pts length=0
D/qrstream(11783): DisplayUpdate.handleMessage Fail
E/qdoverlay(  180): Failed to call ioctl MSMFB_OVERLAY_SET err=Out of memory
E/qdoverlay(  180): MdpCtrl failed to setOverlay, restoring last known good ov info
E/qdoverlay(  180): == Bad OVInfo is:  mdp_overlay z=1 fg=0 alpha=255 mask=-1 flags=0x64000 id=-1
E/qdoverlay(  180): src msmfb_img w=1152 h=1920 format=13 MDP_RGBA_8888
E/qdoverlay(  180): src_rect mdp_rect x=0 y=0 w=1080 h=1920
E/qdoverlay(  180): dst_rect mdp_rect x=0 y=0 w=1080 h=1920
E/qdoverlay(  180): == Last good known OVInfo is:  mdp_overlay z=0 fg=0 alpha=0 mask=0 flags=0x0 id=-1
E/qdoverlay(  180): src msmfb_img w=0 h=0 format=0 MDP_RGB_565
E/qdoverlay(  180): src_rect mdp_rect x=0 y=0 w=0 h=0
E/qdoverlay(  180): dst_rect mdp_rect x=0 y=0 w=0 h=0
E/qdoverlay(  180): MdpCtrl Lkgo ov has id -1, will not restore
E/qdoverlay(  180): Ctrl commit failed set overlay
E/qdhwcomposer(  180): configureLowRes: commit failed for low res panel
D/qrstream(11783): startPipe
D/qrstream(11783): startPipe dropping dead thread
D/qrstream(11783): startPipe building new decodeThread
D/AndroidRuntime(11783): Shutting down VM
W/dalvikvm(11783): threadid=1: thread exiting with uncaught exception (group=0x4183cba8)
I/HotwordWorker(10609): #onHotwordDetectorStarted
E/AndroidRuntime(11783): FATAL EXCEPTION: main
E/AndroidRuntime(11783): Process: com.galois.qrstream, PID: 11783
E/AndroidRuntime(11783): java.lang.NullPointerException
E/AndroidRuntime(11783):    at com.galois.qrstream.lib.CameraManager.<init>(CameraManager.java:47)
E/AndroidRuntime(11783):    at com.galois.qrstream.lib.ReceiveFragment.startPipe(ReceiveFragment.java:601)
E/AndroidRuntime(11783):    at com.galois.qrstream.lib.ReceiveFragment$3.run(ReceiveFragment.java:271)
E/AndroidRuntime(11783):    at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(11783):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(11783):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(11783):    at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime(11783):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(11783):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(11783):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime(11783):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime(11783):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  752):   Force finishing activity com.galois.qrstream/.MainActivity
lcasburn commented 10 years ago

This bug will get triggered whenever hitting the back button on the Receiver to exit the application. It was introduced after switching from the AlertDialog to the Toast notification after receive gets canceled. This is caused by the runShowRxFailedDialog runnable since it will restart the Receive pipe after the camera has been released by the onPause method.

donpdonp commented 10 years ago

The cleanup of clearPendingUIMessages() and the guard of camera != null both look good as-is.