Android App Support crashes after starting

REPRODUCIBILITY: always
OS VERSION: 5.0.0.68
HARDWARE: Sony Xperia 10 V
UI LANGUAGE: en_GB
REGRESSION: yes

DESCRIPTION:

Android App Support no longer starts/crashes and then keeps crashing in a loop as it tries to restart itself (thus also draining the battery). I have happily used AAS in the past months on my 10 V.

PRECONDITIONS:

I think I installed three extra apps at some point recently and then rebooted my phone this morning, just because it has been a while. Afterwards, this problem occurs.

STEPS TO REPRODUCE:

  1. Reboot the device

  2. Start AAS from Settings, if it was not set to boot at start

EXPECTED RESULT:

Android App Support starts normally.

ACTUAL RESULT:

Android App support crashes.

MODIFICATIONS:

Installing some apps via the Aurora app store.

ADDITIONAL INFORMATION:

An excerpt from the systemd journal:

Sep 15 21:41:12 impulse systemd[1]: Created slice system-appsupport\x2dprepare.slice.
Sep 15 21:41:12 impulse systemd[1]: Starting AppSupport prepare

Sep 15 21:41:12 impulse systemd[1]: Created slice system-appsupport.slice.
[
]
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_API=“/opt/appsupport/init/appsupport-common”
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_DATA_ROOT=“/home/.appsupport”
Sep 15 21:41:13 impulse appsupport-init[5612]: export INSTANCE_NAME=“defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export CONFIG_INSTANCE=“–instance defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_GENERATE_CONFIG=“/usr/libexec/appsupport/appsupport-generate-config --config /tmp/appsupport/defaultuser/config.d”
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_PARSE_CONFIG=“/usr/libexec/appsupport/appsupport-parse-config --config /tmp/appsupport/defaultuser/config.d”
Sep 15 21:41:13 impulse appsupport-init[5612]: export PASSWD_HELPER=“/opt/appsupport/libexec/passwd_helper”
Sep 15 21:41:13 impulse appsupport-init[5612]: export BASE_INSTALL_PATH=“/opt/appsupport”
Sep 15 21:41:13 impulse appsupport-init[5612]: export BASE_CONFIG_PATH=“/opt/appsupport/etc”
Sep 15 21:41:13 impulse appsupport-init[5612]: export LXC_CONFIG_PATH=“/tmp/appsupport”
Sep 15 21:41:13 impulse appsupport-init[5612]: export CONTAINER_CONFIG_PATH=“/tmp/appsupport/defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_USER=“defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export PRIVILEGED=0
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_BASE_UID=500000
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_USER_UID=100000
Sep 15 21:41:13 impulse appsupport-init[5612]: export APPSUPPORT_USER_HOME=“/home/defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export ANDROID_DATA_ROOT=“/home/.appsupport/instance/defaultuser”
Sep 15 21:41:13 impulse appsupport-init[5612]: export ANDROID_DATA=/home/.appsupport/instance/defaultuser/data
Sep 15 21:41:13 impulse appsupport-init[5612]: export CONTROL_FILE_PATH=“/tmp/appsupport/defaultuser/control”
Sep 15 21:41:13 impulse appsupport-init[5612]: export ROOTFS_PATH=“/opt/appsupport/rootfs”
Sep 15 21:41:13 impulse appsupport-init[5612]: export SYSTEM_IMAGE_PATH=“/opt/appsupport/system.img”
Sep 15 21:41:13 impulse appsupport-init[5612]: export PRODUCT_IMAGE_PATH=“/opt/appsupport/product.img”
Sep 15 21:41:13 impulse appsupport-init[5612]: Running hooks from prepare-hook.d

Sep 15 21:41:13 impulse appsupport-init[5612]: Running 01-binderfs-setup.sh
Sep 15 21:41:13 impulse ofonod[4920]: [gbinder] ERROR! Can’t open /dev/hwpuddlejumper: Permission denied
Sep 15 21:41:13 impulse kernel: binder: 4920:4920 transaction failed 29189/-22, size 0-0 line 2785
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 02-data-root.sh
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 05-create-storage-directory.sh
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 10-graphics.sh
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 10-start-lxc-net.sh
[
.]
Sep 15 21:41:13 impulse systemd[1]: Started LXC network bridge setup.
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 20-clear-caches.sh
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 20-create-appsupport-root-home.sh
Sep 15 21:41:13 impulse appsupport-init[5612]: Running 20-mount-rootfs.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 30-privilege-migration.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 30-set-container-node-permissions.sh
Sep 15 21:41:14 impulse kernel: binder: 4920:4920 transaction failed 29189/-22, size 0-0 line 2785
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 35-storage-migration.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 60-generate-bsp-config.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 70-generate-properties.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 70-generate-rootfs-config.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 75-generate-privilege-config.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 90-setup.sh
Sep 15 21:41:14 impulse appsupport-init[5612]: Running 98-anr-and-logger.sh
Sep 15 21:41:14 impulse kernel: binder: 4920:4920 transaction failed 29189/-22, size 0-0 line 2785
Sep 15 21:41:14 impulse systemd[1]: Started AppSupport prepare.
Sep 15 21:41:14 impulse systemd[1]: Starting AppSupport

[
]
Sep 15 21:41:16 impulse appsupport-init[5612]: Start --user apkd-bridge.service
Sep 15 21:41:16 impulse systemd[3263]: Starting Bridge native privileged data to AppSupport

Sep 15 21:41:16 impulse systemd[3263]: Started Bridge native privileged data to AppSupport.
Sep 15 21:41:16 impulse appsupport-init[5612]: Start --user apkd-bridge-hw.service
Sep 15 21:41:16 impulse systemd[3263]: Starting Bridge native data to AppSupport

Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [W] unknown:0 - Sensor not supported ( QAmbientLightSensor )
Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [W] unknown:0 - Sensor not supported ( QCompass )
Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [W] unknown:0 - Sensor not supported ( QRotationSensor )
Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [D] unknown:0 - Starting bridge for “default” (“android.hardware.graphics.allocator@4.0::IAllocator”, “android.hardware.graphics.allocator@3.0::IAllocator”, “android.hardware.graphics.allocator@2.0::IAllocator”) on /dev/hwpuddlejumper from /dev/hwbinder
Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [D] unknown:0 - Starting bridge for “default” (“android.hardware.power@1.3::IPower”, “android.hardware.power@1.2::IPower”, “android.hardware.power@1.1::IPower”, “android.hardware.power@1.0::IPower”) on /dev/hwpuddlejumper from /dev/hwbinder
Sep 15 21:41:16 impulse droid-hal-init: Control message: Could not find ‘android.hardware.graphics.allocator@2.0::IAllocator/default’ for ctl.interface_start from pid: 1199 (/system/system_ext/bin/hwservicemanager)
Sep 15 21:41:16 impulse droid-hal-init: Control message: Could not find ‘android.hardware.graphics.allocator@2.0::IAllocator/default’ for ctl.interface_start from pid: 1199 (/system/system_ext/bin/hwservicemanager)
Sep 15 21:41:16 impulse apkd-bridge-hw[6178]: [D] unknown:0 - Starting bridge for “legacy/0” (“android.hardware.camera.provider@2.4::ICameraProvider”) on /dev/hwpuddlejumper from /dev/hwbinder
Sep 15 21:41:16 impulse droid-hal-init: Control message: Could not find ‘android.hardware.camera.provider@2.4::ICameraProvider/legacy/0’ for ctl.interface_start from pid: 1199 (/system/system_ext/bin/hwservicemanager)
Sep 15 21:41:16 impulse droid-hal-init: Control message: Could not find ‘android.hardware.camera.provider@2.4::ICameraProvider/legacy/0’ for ctl.interface_start from pid: 1199 (/system/system_ext/bin/hwservicemanager)
Sep 15 21:41:16 impulse systemd[3263]: Started Bridge native data to AppSupport.
[
.]
Sep 15 21:41:24 impulse appsupport-init[6970]: Running hooks from start-post-hook.d

Sep 15 21:41:24 impulse appsupport-init[6970]: Running 50-setup.sh
[
]
Sep 15 21:41:24 impulse systemd[1]: Started AppSupport.
Sep 15 21:41:24 impulse d-bridge[4236]: [W] unknown:0 - Discarding parcel with 4 bytes unread.
Sep 15 21:41:24 impulse d-bridge[4236]: [W] unknown:0 - Discarding parcel with 4 bytes unread.
Sep 15 21:41:24 impulse d-bridge[4236]: [W] unknown:0 - Discarding parcel with 36 bytes unread.
Sep 15 21:41:24 impulse d-bridge[4236]: [W] unknown:0 - Successfully notified AppSupport contacts service of current contacts.
[
]
Sep 15 21:41:27 impulse apkd-bridge-hw[6178]: [W] unknown:0 - “GNSS Remote died, cleaning up!”
Sep 15 21:41:27 impulse kernel: binder: send failed reply for transaction 77817 to 7172:7202
Sep 15 21:41:27 impulse kernel: binder: send failed reply for transaction 77818 to 7172:7234
Sep 15 21:41:27 impulse kernel: binder: send failed reply for transaction 77819 to 7172:7172
Sep 15 21:41:27 impulse kernel: binder: 6178:6178 BC_DEAD_BINDER_DONE 0000000000000001 not found
Sep 15 21:41:27 impulse apkd-bridge-hw[6178]: [W] unknown:0 - alien.connectivity died! Trying to reconnect.
Sep 15 21:41:27 impulse d-bridge[4236]: [W] unknown:0 - alien died! Trying to reconnect.
Sep 15 21:41:27 impulse kernel: binder: 4236:4236 BC_DEAD_BINDER_DONE 0000000000000005 not found
Sep 15 21:41:27 impulse d-bridge[4236]: [W] unknown:0 - appsupport.inputattachservice died! Trying to reconnect.
[
]
Sep 15 21:41:30 impulse d-bridge[4236]: [W] unknown:0 - appsupport.contacts died! Trying to reconnect.
Sep 15 21:41:30 impulse d-bridge[4236]: [W] unknown:0 - appsupport.media.control died! Trying to reconnect.
Sep 15 21:41:30 impulse d-bridge[4236]: [W] unknown:0 - appsupport.audio.control died! Trying to reconnect.
Sep 15 21:41:30 impulse d-bridge[4236]: [W] unknown:0 - appsupport.intent.resolver died! Trying to reconnect.
Sep 15 21:41:30 impulse d-bridge[4236]: [W] unknown:0 - appsupport.media.file_observer died! Trying to reconnect.
Sep 15 21:41:31 impulse systemd[1]: appsupport@defaultuser.service: Main process exited, code=exited, status=1/FAILURE
Sep 15 21:41:31 impulse systemd[1]: appsupport@defaultuser.service: Failed with result ‘exit-code’.

( I removed most selinux and other kernel messages to make the logs more clear, let me know if anyone wants to see the full journal.)

2 Likes

I have already tried the “Clean removal” described in the SFOS docs.

I also tried to uninstall the three recently installed apps, but that does not seem to work if AAS cannot start. I also did not manage to use apkd-uninstall from the terminal.

1 Like

Both lines from your output are not present for me when I start AAS:

ofonod[4920]: [gbinder] ERROR! Can’t open /dev/hwpuddlejumper: Permission denied

apkd-bridge-hw[6178]: [W] unknown:0 - “GNSS Remote died, cleaning up!”

Try to change permissions maybe?

# ls -hal /dev/hwpuddlejumper
crw-rw-rw-    1 root     root       10,  53 Sep 14 11:16 /dev/hwpuddlejumper

Also I just learned that GNSS might stand for assisted GPS - try to switch off Location before enabling AAS?

1 Like

It seems that /dev/hwpuddlejumper does not exist when AAS is not started/running. So, I assume it is created with the right permissions.

I also saw that, and tried without Location switched off but it does not help. As you can see in the logs, GNSS is not the only stuff crashing, all kinds of emulation/bridging stuff such as audio control, contacts, etc. also die.

It does on my phone. It’s not a 10 V however, it’s a 10 II.

You could also try to rename all AAS-specific directories under /home

1 Like

C2 5.0.0.70 I suffer from a severe slow problem and interruption when running applications on Android App Support and this is very annoying and sometimes works smoothly I do not know the reason but it is worrying

I think thst often that will be a ram problem. I nowadays fsce this often with Whatsapp. App will crash or close


I have no /dev/*puddle* at all so I linked them from /dev/binderfs now. It didn’t help unfortunately.

Trying to start it with the /home/.appsupport en /home/appsupport-root moved aside is a good idea, will try it! :+1:

1 Like

That did the trick! So it is something in the original ASS state data that makes it crash, so probably the more recently installed apps. Now how to remove those manually


I ended up removing those directories and completely rebuilding my Android setup.
It wasn’t fun and cost a lot of time, but I guess this is hopefully unreproducible and cannot really be solved any more now.

Still, I will mark it as solved. I hope I never find out which app broke everythingđŸ€ž

1 Like

So the repeated starting/crashing AAS came back last week :frowning:, so I unmarked this topic as “Solved”. After the Sailfish OS BoF, @rainemak suggested to run:

# systemctl-user stop apkd-bridge.service

That seemed to do.. something but it didn’t help with the restart loop.
When I using more specific journalctl commands, I found out that AAS actually starts, and then crashes:

# journalctl -f -u "appsupport*@defaultuser.service" -u lxc@multi-user.service
Feb 02 19:45:52 impulse systemd[1]: Starting AppSupport prepare...
[...]
Feb 02 19:45:55 impulse systemd[1]: Started AppSupport prepare.
Feb 02 19:45:55 impulse systemd[1]: Starting AppSupport...
Feb 02 19:45:55 impulse appsupport-init[17167]: Waiting for hwservicemanager...
Feb 02 19:45:56 impulse appsupport-init[16503]: Running hooks from prepare-post-hook.d...
Feb 02 19:45:56 impulse appsupport-init[16503]: Running 50-start-supplementary-services.sh
Feb 02 19:45:56 impulse appsupport-init[16503]: Start --user appsupportaudio.service
Feb 02 19:45:56 impulse appsupport-init[16503]: Start --user appsupportkeyboard.service
Feb 02 19:45:56 impulse appsupport-init[16503]: Start --user apkd-bridge.service
Feb 02 19:45:56 impulse appsupport-init[16503]: Start --user apkd-bridge-hw.service
Feb 02 19:45:58 impulse appsupport-init[17566]: Running hooks from start-post-hook.d...
Feb 02 19:45:58 impulse appsupport-init[17566]: Running 50-setup.sh
Feb 02 19:45:59 impulse appsupport-init[17566]: mount: 'tmpfs'->'/sys/fs/selinux': Invalid argument
Feb 02 19:45:59 impulse systemd[1]: Started AppSupport.

So, then I executed the command suggested by the SFOS docs when AAS starts and found something interesting!

# appsupport-attach /system/bin/logcat
[...]
02-02 19:45:44.798   223   547 I system_server: Starting a blocking GC Alloc
02-02 19:45:44.798   223   295 W system_server: Throwing OutOfMemoryError "Failed to allocate a 16 byte allocation with 1357264 free bytes and 1325KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC." (VmSize 17270780 kB)
02-02 19:45:44.798   223   285 I system_server: WaitForGcToComplete blocked Alloc on Alloc for 452.188ms
02-02 19:45:44.798   223   285 I system_server: Starting a blocking GC Alloc
--------- beginning of crash
02-02 19:45:44.798   223   295 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: jobscheduler.bg
02-02 19:45:44.798   223   295 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 1357264 free bytes and 1325KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
02-02 19:45:44.798   223   295 E AndroidRuntime: 	at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)
02-02 19:45:44.798   223   295 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:199)
02-02 19:45:44.798   223   295 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
02-02 19:45:44.798   223   295 E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:67)

So it seems I run into an Android runtime OOM kill that makes the whole AAS crash. This seems to be invisible from SFOS/systemd. My intuition is that one/some of my apps require too much, so now I want to disable them starting with these apps when the AAS starts, but the Settings app won’t let me because the setting is only available when AAS us running.

Does anybody know how to disable the automatic starting up of Android apps?

2 Likes

Holy shiznit.

For X10III Android 11, this just worked to instantly restore AppSupport start ability:

$ systemctl –-user stop apkd-bridge-hw

(Not sure where apk-bridged exists, maybe newer A13 AAS devices?)

Couple days ago, I ran # systemctl edit appsupport@defaultuser for [Service] Restart=no, so when it crashes, it wouldn’t kill my battery in a restart loop. (PS Sorely disappointed @jolla has left this AAS crash loop debacle [yet another] papercut linger this long.)

Seemingly innocent change, but now AAS would not start after a crash, not even from Settings panel Start button. No idea (yet) what the connection is.

But stopping apkd-bridge-hw instantly made everything work just now.

When did they discover this, how long have they been sitting on this info? :expressionless_face:

4 Likes

I’m glad it helps your case, at least!
I think he talked about it like remembering it as a relatively recent regression. The upcoming 5.1 release will have several AAS improvements, so hopefully also this.

And sorry, it was apkd-bridge.service, instead of apk-bridged.service. Fixed my previous post.

2 Likes

Does anybody know how to disable the automatic starting up of Android apps?

Settings =» Apps =» tap your app

1 Like

That is not possible if ASS is not running. It will say that it needs to be enabled first :wink:

Similarly, you can also not uninstall apps, because long pressing and then pressing the X will launch ASS to uninstall the app, which also gets into the loop.
I probably really need to manipulate some file or move away files somewhere under /home/.appsupport.

1 Like

It is from the last point “fix” release, but that was also several weeks ago..

Yes, I think he mentioned that IIRC.

It is one of systemd’s default tasks to stop services from restarting endlessly. Restart=Always does not simply disable that functionality, but there is so much more config in that service file, I have no idea if all of it together couldn’t still amount to significant battery drain.

Is this a known “papercut” that definitely has its roots in service misconfiguration?

“Papercut” was intended for this whole AAS crash loop debacle, unrelated to systemd service setup. Edited op for clarity.

But yes, that service file was scary massive :exploding_head:

Is there some history in bug reports or similar? I have never experienced this and from the forums all I know are just crashes (not loops).