termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

Android crashing when i try to open notification bar #382

Closed RaWolFoX closed 1 year ago

RaWolFoX commented 1 year ago

When i open termux-x11, and try to open notification bar, android crashes. Then phone hang 5 secs and android lock screen appears. Its also happening without starting termux server. So problem is the termux-x11 app. I don't know which log will be helpful.

RaWolFoX commented 1 year ago

Im using this build https://github.com/termux/termux-x11/actions/runs/5596238384

Also happening on previous few builds.

ask9027 commented 1 year ago

Im using this build https://github.com/termux/termux-x11/actions/runs/5596238384

Also happening on previous few builds.

try to reinstall

twaik commented 1 year ago

It is pretty much weird. Android app contains literally nothing. It has only some mechanism to pass Surface to X server via Binder and uses the same mechanism to obtain connection. After this it only sends events via obtained connection. Besides that termux-x11 uses only standard Android APIs.

twaik commented 1 year ago

I think I need to see system wide logcat log to identify a problem.

twaik commented 1 year ago

I do not see here exact moment when system crashes. Can you make logcat -c before crashing it and stop collecting log right after crash?

RaWolFoX commented 1 year ago

I do not see here exact moment when system crashes. Can you make logcat -c before crashing it and stop collecting log right after crash?

installed recent build.now there is no problems. Maybe its my phone's fault?.

twaik commented 1 year ago

Maybe.

RaWolFoX commented 1 year ago

Maybe.

Hey.its happening when notification is enabled for termux-x11 app. Disabling notification for the app in android setting fixed the crashing. Maybe bug in notification?

twaik commented 1 year ago

Maybe. I'll check it out.

RaWolFoX commented 1 year ago

Maybe. I'll check it out.

Should I open a new issue for this?🤔

twaik commented 1 year ago

No.

RaWolFoX commented 1 year ago

Still its crashing. Btw not happening on another phone(android 13). Maybe android 11 issue?. My phone is running on android 11. Need log?. Its not showing notification.

twaik commented 1 year ago

It looks like I should connect directly to your device and check it myself.

RaWolFoX commented 1 year ago

It looks like I should connect directly to your device and check it myself.

Ok. Which remote desk app should i install?

twaik commented 1 year ago

I'll be ready in a few hours (after 9.30 PM GMT+2). It will be better to use discord (.twaik) or telegram.

RaWolFoX commented 1 year ago

I'll be ready in a few hours (after 9.30 PM GMT+2). It will be better to use discord (.twaik) or telegram.

Hey i think notification is broken after updating the icons. This is the build thats causing this crash .

This build's notification works fine without crash. Its the build before icon update.

Can you just check this.

twaik commented 1 year ago

Can you post text of an error? It should be available with TERMUX_X11_DEBUG=1.

RaWolFoX commented 1 year ago

Can you post text of an error? It should be available with TERMUX_X11_DEBUG=1.

``` --------- beginning of main 07-28 04:20:15.204 15392 15392 D OplusUtils: OplusUtils [83]: 07-28 04:20:15.207 15392 15392 E libc : Access denied finding property "persist.vendor.debug.en.drpcrpt" 07-28 04:20:15.223 15392 15392 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 10696 <<<<<< 07-28 04:20:15.240 15392 15392 E libc : Access denied finding property "persist.device_config.runtime_native_boot.profilebootclasspath" 07-28 04:20:15.240 15392 15392 E libc : Access denied finding property "persist.device_config.runtime_native_boot.enable_apex_image" 07-28 04:20:15.240 15392 15392 I AndroidRuntime: Using default boot image 07-28 04:20:15.240 15392 15392 E libc : Access denied finding property "persist.device_config.runtime_native_boot.disable_lock_profiling" 07-28 04:20:15.240 15392 15392 I AndroidRuntime: Leaving lock profiling enabled 07-28 04:20:15.240 15392 15392 E libc : Access denied finding property "persist.device_config.runtime_native_boot.enable_generational_cc" 07-28 04:20:15.482 15392 15392 D app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat 07-28 04:20:15.482 15392 15392 D app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt66l.dat 07-28 04:20:15.547 15392 15392 W app_process: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes 07-28 04:20:15.572 15392 15392 D AndroidRuntime: Calling main entry com.termux.x11.Loader 07-28 04:20:15.574 15392 15392 I Termux:X11 loader: started 07-28 04:20:15.634 15392 15392 W app_process: unable to execute idmap2: Permission denied 07-28 04:20:15.634 15392 15392 W OverlayConfig: 'idmap2 create-multiple' failed: no mutable="false" overlays targeting "android" will be loaded 07-28 04:20:15.626 15392 15392 W main : type=1400 audit(0.0:361496): avc: denied { execute } for name="idmap2" dev="sda7" ino=309 scontext=u:r:untrusted_app_27:s0:c184,c258,c512,c768 tcontext=u:object_r:idmap_exec:s0 tclass=file permissive=0 app=com.termux.api 07-28 04:20:15.679 15392 15392 W app_process: unable to execute idmap2: Permission denied 07-28 04:20:15.679 15392 15392 W OverlayConfig: 'idmap2 create-multiple' failed: no mutable="false" overlays targeting "oplus" will be loaded 07-28 04:20:15.674 15392 15392 W main : type=1400 audit(0.0:361497): avc: denied { execute } for name="idmap2" dev="sda7" ino=309 scontext=u:r:untrusted_app_27:s0:c184,c258,c512,c768 tcontext=u:object_r:idmap_exec:s0 tclass=file permissive=0 app=com.termux.api 07-28 04:20:15.686 15392 15392 E RefClass: java.lang.reflect.InvocationTargetException 07-28 04:20:15.687 15392 15392 I OneTrace: Mark active for pid=15392? true --------- beginning of system 07-28 04:20:15.879 15392 15392 I PackageParsing: com.termux.x11: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE 07-28 04:20:16.034 15392 15392 I Termux:X11 loader: loading /data/app/~~rQYepleXZuY28-jnqut4mQ==/com.termux.x11-63ZlNUxnbNsOqY0yDXRMbA==/base.apk of com.termux.x11 application 07-28 04:20:16.513 15392 15392 I Termux:X11 loader: starting com.termux.x11.CmdEntryPoint::main(); 07-28 04:20:16.526 15392 15392 I OneTrace: Mark active for pid=15392? true 07-28 04:20:16.527 15392 15392 D NetworkSecurityConfig: No Network Security Config specified, using platform default 07-28 04:20:16.527 15392 15392 D NetworkSecurityConfig: No Network Security Config specified, using platform default 07-28 04:20:16.544 15392 15392 V LorieNative: Using TMPDIR="/data/data/com.termux/files/usr/tmp" 07-28 04:20:16.554 15392 15476 E CmdEntryPoint: Listening port 7892 07-28 04:20:16.616 15392 15475 D libEGL : loaded /vendor/lib64/egl/libEGL_adreno.so 07-28 04:20:16.654 15392 15392 W Binder:15392_2: type=1400 audit(0.0:361502): avc: denied { setattr } for name="" dev="pipefs" ino=46693362 scontext=u:r:untrusted_app_27:s0:c184,c258,c512,c768 tcontext=u:r:untrusted_app_27:s0:c184,c258,c512,c768 tclass=fifo_file permissive=0 app=com.termux.api 07-28 04:20:16.672 15392 15475 D libEGL : loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so 07-28 04:20:16.694 15392 15475 D libEGL : loaded /vendor/lib64/egl/libGLESv2_adreno.so 07-28 04:20:16.765 15392 15475 E libEGL : Invalid file path for libcolorx-loader.so 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: QUALCOMM build : 319c6d8, Ic907de5ed0 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Build Date : 09/21/20 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.01 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Local Branch : 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.9.11.R1.10.00.00.679.015 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Remote Branch : NONE 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Reconstruct Branch : NOTHING 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Build Config : S P 10.0.5 AArch64 07-28 04:20:16.841 15392 15475 I AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so 07-28 04:20:16.884 15392 15475 I AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000 --------- beginning of main 07-28 04:20:16.570 14082 14082 V LorieBroadcastReceiver: Got new ACTION_START intent 07-28 04:20:16.579 14082 14082 V LorieBroadcastReceiver: Extracting logcat fd. 07-28 04:20:16.674 14082 14082 D LorieNative: Starting logcat with output to given fd 07-28 04:20:16.830 14082 14082 V LorieBroadcastReceiver: Extracting X connection socket. 07-28 04:20:16.891 15392 15475 D gles-renderer: Xlorie: Initialized EGL version 1.5 07-28 04:20:16.891 15392 15475 D gles-renderer: Xlorie: egl error on line 173: EGL not initialized or failed to initialize 07-28 04:20:16.892 15392 15475 E libEGL : Invalid file path for libcolorx-loader.so 07-28 04:20:16.892 15392 15475 D gles-renderer: Xlorie: egl error on line 182: EGL not initialized or failed to initialize 07-28 04:20:16.893 15392 15475 D gles-renderer: Xlorie: egl error on line 185: EGL not initialized or failed to initialize 07-28 04:20:16.893 15392 15475 D gles-renderer: Xlorie: egl error on line 197: EGL not initialized or failed to initialize 07-28 04:20:16.906 15392 15475 E gles-renderer: There is no current context, `renderer_set_buffer` is call is cancelled 07-28 04:20:17.051 15392 15475 D gles-renderer: Xlorie: updating cursor 07-28 04:20:17.055 15392 15475 D gles-renderer: Xlorie: updating cursor 07-28 04:20:17.056 14082 14082 D LorieNative: XCB connection is successfull 07-28 04:20:17.082 15392 15475 E tx11-request: window changed: 720 1536 07-28 04:20:17.087 15392 15475 E gles-renderer: There is no current context, `renderer_set_buffer` is call is cancelled 07-28 04:20:17.077 14082 14082 D SurfaceChangedListener: Surface was changed: 720x1536 07-28 04:20:17.087 15392 15446 D LorieNative: window change: 0x0 07-28 04:20:17.093 15392 15475 V LorieNative: New framerate is 60 07-28 04:20:17.093 15392 15475 D gles-renderer: renderer_set_window 0x0 0 0 07-28 04:20:17.093 15392 15475 D gles-renderer: Xlorie: updating cursor 07-28 04:20:17.501 14082 14082 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusScreenModeFeature 07-28 04:20:17.501 14082 14082 I oplus.android.OplusFrameworkFactoryImpl: getOplusScreenModeFeature 07-28 04:20:17.507 14082 14082 I oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusScreenModeFeature 07-28 04:20:17.507 14082 14082 I oplus.android.OplusFrameworkFactoryImpl: getOplusScreenModeFeature ```
twaik commented 1 year ago

No, there is no exception. Maybe you can somehow get system-wide logcat?

RaWolFoX commented 1 year ago

No, there is no exception. Maybe you can somehow get system-wide logcat?

I thinks its related to icons?. Maybe.

twaik commented 1 year ago

Every crash must be logged to logcat.

RaWolFoX commented 1 year ago

Every crash must be logged to logcat.

I think its a android 11 thing because notification is showing fine on android 13. Android 11 is Crashing because of compatibility or something?

RaWolFoX commented 1 year ago

Sorry for my dumb questions😬

RaWolFoX commented 1 year ago

Every crash must be logged to logcat.

Hey, maybe its crashing because of 8000dp in app/src/main/res/drawable/ic_x11_icon.xml ?

Android recommended size for notification icons is 24x24 dp or 48x48 px. ???? 🤔.. Don't mind if its a foolish question 😁

twaik commented 1 year ago

I can not tell you the reason of crash without logcat.

RaWolFoX commented 1 year ago

log.txt

I tried to get logcat immediately after crash👆

Need more log?

twaik commented 1 year ago

Ok, for some reason I did not see pinned logs on my phone.

twaik commented 1 year ago

I do not know why but I see no crashes of com.termux.x11 in the log.

twaik commented 1 year ago

Try the following:

  1. Start Termux:X11 app and prepare to reproduce the crash.
  2. Run logcat -c in adb (to clear logs) and start logcat.
  3. Right after that reproduce the crash (preferably in the same second).
  4. Wait 2 secs after you see Termux:X11 crash.
  5. Stop collecting logcat and post it here.
RaWolFoX commented 1 year ago

Try the following:

  1. Start Termux:X11 app and prepare to reproduce the crash.
  2. Run logcat -c in adb (to clear logs) and start logcat.
  3. Right after that reproduce the crash (preferably in the same second).
  4. Wait 2 secs after you see Termux:X11 crash.
  5. Stop collecting logcat and post it here.

Ok

RaWolFoX commented 1 year ago

Log posted👍🏻

twaik commented 1 year ago

The log is too long. Did you clear it the second before reproducing the crash? I see you did not.

RaWolFoX commented 1 year ago

The log is too long. Did you clear it the second before reproducing the crash? I see you did not.

Already cleared before taking

twaik commented 1 year ago

The first timestamp is 13:04:54.294, the last is 13:05:55.844. Logcat was running at least for a minute. I need to get logcat of the seconds of the crash. Not minutes.

RaWolFoX commented 1 year ago

Please come to discord.

agnostic-apollo commented 1 year ago
W StatusBarIconView: Drawable is too large (16000x13000) StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.termux.x11 id=0x7f080094) visible user=0 )
ActivityManager: ANR in com.android.systemui
ActivityManager: Reason: Input dispatching timed out (92eee48 StatusBar (server) is not responding. Waited 5319ms for MotionEvent)
ActivityManager: Process com.android.systemui (pid 3212) has died: pers PER 
RaWolFoX commented 1 year ago
W StatusBarIconView: Drawable is too large (16000x13000) StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.termux.x11 id=0x7f080094) visible user=0 )
ActivityManager: ANR in com.android.systemui
ActivityManager: Reason: Input dispatching timed out (92eee48 StatusBar (server) is not responding. Waited 5319ms for MotionEvent)
ActivityManager: Process com.android.systemui (pid 3212) has died: pers PER 

Yes its the icon. Sometimes i need to force restart with power button + volume up for reviving my phone :-(. Maybe thats why log is too long 😐

RaWolFoX commented 1 year ago

So no more logs needed?

twaik commented 1 year ago

There are no values like 16000 or 13000 in the project. I have no idea why it is like that.

agnostic-apollo commented 1 year ago

Probably doubling.

https://developer.android.com/training/multiscreen/screendensities

https://github.com/termux/termux-x11/blob/91202c0c129dd720ee71352ca4247f5e47d949c1/app/src/main/res/drawable/ic_x11_icon.xml#L3-L4

RaWolFoX commented 1 year ago

xhdpi @ 8000dp = 16000px??

16000 is in pixels. I think🤔

twaik commented 1 year ago

Ok. But how to fix this?

RaWolFoX commented 1 year ago

Ok. But how to fix this?

Ignore if its too complicated. We can use x11 without enabling notification 😬

agnostic-apollo commented 1 year ago

Would have to read android docs to properly create icons. But even the highest xxxhdpi needs to be 640dp and you are using a bonkers 8000dp value for an icon.

https://developer.android.com/training/multiscreen/screendensities#TaskProvideAltBmp

twaik commented 1 year ago

Ok, try the latest apk.

RaWolFoX commented 1 year ago

Ok, try the latest apk.

Fixed. Working fine😍👍🏻

twaik commented 1 year ago

Good.