Android Question Msgbox OK with external keyboard causes crash

pfhrr

Member
Licensed User
I am using Msgbox in an app and when I use an external Bluetooth keyboard pressing Enter to close the message box cause the app to crash unexpectedly.

I get similar results when using Msgbox2.

Code is shown below. The log shows the log entry before the app crashes.

B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Test_layout")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Msgbox("Hello world","This is the title")
Log("end of Sub Button1_Click")
End Sub
 

pfhrr

Member
Licensed User
No electricity here for 18 hours due to wind storm. :(

I'll connect via USB when power is back. Nothing in the log when connected via WiFi bridge.
 
Upvote 0

pfhrr

Member
Licensed User
Are you connected to the device with USB debug mode? If so please post the unfiltered logs.

Crash after third OK <enter>. Unfiltered log:

type=1400 audit(0.0:152880): avc: denied { search } for name="1" dev="proc" ino=7317 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0
type=1400 audit(0.0:152881): avc: denied { search } for name="2" dev="proc" ino=10411 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152882): avc: denied { search } for name="3" dev="proc" ino=10412 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152883): avc: denied { search } for name="6" dev="proc" ino=10415 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152884): avc: denied { search } for name="16" dev="proc" ino=10416 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152885): avc: denied { search } for name="17" dev="proc" ino=10417 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152886): avc: denied { search } for name="18" dev="proc" ino=10418 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152887): avc: denied { search } for name="23" dev="proc" ino=10420 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152888): avc: denied { search } for name="24" dev="proc" ino=10421 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152889): avc: denied { search } for name="25" dev="proc" ino=10422 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152890): avc: denied { search } for name="26" dev="proc" ino=10423 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152891): avc: denied { search } for name="27" dev="proc" ino=10424 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152892): avc: denied { search } for name="28" dev="proc" ino=10425 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152893): avc: denied { search } for name="29" dev="proc" ino=10426 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152894): avc: denied { search } for name="30" dev="proc" ino=10427 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152895): avc: denied { search } for name="31" dev="proc" ino=10428 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152896): avc: denied { search } for name="32" dev="proc" ino=10429 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152897): avc: denied { search } for name="33" dev="proc" ino=10430 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152898): avc: denied { search } for name="34" dev="proc" ino=10431 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
type=1400 audit(0.0:152899): avc: denied { search } for name="35" dev="proc" ino=10432 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0
>>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
CheckJNI is OFF
No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
register_android_hardware_Radio DONE
Calling main entry com.android.commands.am.Am
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=b4a.example/.main} from uid 2000 on display 0
Shutting down VM
Start proc 15149:b4a.example/u0a83 for activity b4a.example/.main
ClassLoader referenced unknown path: /data/app/b4a.example-2/lib/arm
Use EGL_SWAP_BEHAVIOR_PRESERVED: true
<qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
Initialized EGL, version 1.4
Switching to real app window: Window{8cc2b03 u0 b4a.example/b4a.example.main}
Displayed b4a.example/.main: +343ms
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@be175d6 attribute=null, token = android.os.BinderProxy@fab5fb2
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
ACDB -> send_afe_cal
enable_snd_device: snd_device(2: speaker)
enable_audio_route: apply and update mixer path: low-latency-playback
disable_audio_route: reset and update mixer path: low-latency-playback
disable_snd_device: snd_device(2: speaker)
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
ACDB -> send_afe_cal
enable_snd_device: snd_device(2: speaker)
enable_audio_route: apply and update mixer path: low-latency-playback
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@973a02d attribute=android.view.inputmethod.EditorInfo@d71962, token = android.os.BinderProxy@fab5fb2
end of Sub Button1_Click
disable_audio_route: reset and update mixer path: low-latency-playback
disable_snd_device: snd_device(2: speaker)
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
ACDB -> send_afe_cal
enable_snd_device: snd_device(2: speaker)
enable_audio_route: apply and update mixer path: low-latency-playback
mixer(0xb41c0000) throttle end: throttle time(10)
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
end of Sub Button1_Click
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a971229 attribute=null, token = android.os.BinderProxy@fab5fb2
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
mixer(0xb41c0000) throttle end: throttle time(4)
Failed to find a new network - expiring NetTransition Wakelock
out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@32f1adc attribute=null, token = android.os.BinderProxy@fab5fb2
end of Sub Button1_Click
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x700073 in tid 15149 (b4a.example)
mixer(0xb41c0000) throttle end: throttle time(7)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/razor/flo:6.0.1/MMB29V/2554798:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 15149, tid: 15149, name: b4a.example >>> b4a.example <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x700073
r0 00000001 r1 a1dbf0a4 r2 b6eaa54f r3 00700073
r4 aa605220 r5 a1dbf090 r6 00000000 r7 00000022
r8 aa60526c r9 00000000 sl 00000001 fp b6f23c11
ip b6ec388c sp befc3078 lr b6e64c99 pc b6f1fe18 cpsr 00070030
backtrace:
#00 pc 00012e18 /system/lib/libutils.so (android::Looper::pollInner(int)+551)
#01 pc 00012ed3 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+130)
#02 pc 00081ce1 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+22)
#03 pc 71d5b56d /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ec9000)
type=1400 audit(0.0:153245): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7733 scontext=u:r:debuggerd:s0 tcontext=u:eek:bject_r:gpu_device:s0 tclass=chr_file permissive=0
type=1400 audit(0.0:153246): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=7733 scontext=u:r:debuggerd:s0 tcontext=u:eek:bject_r:gpu_device:s0 tclass=chr_file permissive=0
Force finishing activity b4a.example/.main
Tombstone written to: /data/tombstones/tombstone_09
AM write failed: Broken pipe
Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)
Buffer count: 7
WIN DEATH: Window{8cc2b03 u0 b4a.example/b4a.example.main}
WIN DEATH: Window{f5f88b9 u0 b4a.example/b4a.example.main}
Exception thrown during pause
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:727)
at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:867)
at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2907)
at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2763)
at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2760)
at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:12037)
at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:11933)
at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:12622)
at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:12129)
at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
Error writing /proc/15149/oom_score_adj; errno=22
Process 15149 exited due to signal (11)
Process b4a.example (pid 15149) has died
Initialized EGL, version 1.4
Failed to dispatch window animation state change.android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
disable_audio_route: reset and update mixer path: low-latency-playback
disable_snd_device: snd_device(2: speaker)
 
Upvote 0

pfhrr

Member
Licensed User
Nexus 7 (mk2)
Android 6.0.1
tmp_6744-Screenshot_20161010-050600-1128132329.png
 
Upvote 0

pfhrr

Member
Licensed User
Is the latest OS that your tablet supports?

It wasn't. I've now installed the latest available update, still Android 6.0.1, and get the same results when using Bluetooth External Keyboard and Msgbox.
 
Upvote 0

afields

Member
Licensed User
hello ! i also have this behavior when i show a name with a msgbox. i supposed that it was related with the end of an activity (those that show the name) and the call of the main activity ( those where i show all names ( via sqlite)). but after making some test it was the same error that i've got. so now i will try with that.
thank you
 
Upvote 0

pfhrr

Member
Licensed User
I was able to reproduce it. It is related to the way that the Click event is raised.

It will work with this code:
B4X:
Sub Button1_Click
   CallSubDelayed(Me, "Button1_ClickAfter")
End Sub

Sub Button1_ClickAfter
   Msgbox("Hello world","This is the title")
   Log("end of Sub Button1_Click")
End Sub

Yes - Thank you very much. This code works 100%.
 
Upvote 0
Top