notes-android
notes-android copied to clipboard
"TransactionTooLargeException: data parcel size 552920 bytes" with large note on activity lost focus
Hello, I use nextcloud-notes android client 0.24.3 on android 8.
- Create new note
- Put inside some large enough text
- Press "show desktop" or "show opened applications" system button, so the notes activity will lose focus while note editor is opened
result: application crash with exception:
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 552920 bytes
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4057)
at android.os.Handler.handleCallback(Handler.java:793)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6701)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:249)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
Caused by: android.os.TransactionTooLargeException: data parcel size 552920 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:758)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:4736)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4049)
... 7 more
The note itself stays safe, though.
Evedently, the problem happens when the app activity tries to save its state on activity stop event and exceeds data parcel to save size limit.
How mich data do you have in one note? do you have base64-coded images or such stuff in your notes?
no pictures, just regular text in unicode, 176KB example: https://pastebin.com/7Hn4rmJg (some citations from the book while reading)
Can you specify which phone you are using and how much RAM you have available? I am not able to reproduce this issue with the given pastebin sample.
I have Mi MIX 2 Android 8.0 6 Gb RAM
Just tried again and got this exception again.
this looks like a kind of internal limitation https://developer.android.com/reference/android/os/TransactionTooLargeException
Are you able to reproduce this issue wit another device (or in a virtual machine)?
I still have trouble reproducing it, even with (emulated) low-end-smartphone with 512 MB RAM.
Also the note is less than 200 kB which should really not be an issue... 😕
ping @sadr0b0t
Just got it on emulator Nexus 9 API 28 Android 9.0
Name: Nexus_9_API_28
CPU/ABI: Google APIs Intel Atom (x86)
Path: /home/benderamp/.android/avd/Nexus_9_API_28.avd
Target: google_apis [Google APIs] (API level 28)
Skin: nexus_9
SD Card: 512 MB
fastboot.chosenSnapshotFile:
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: Nexus 9
hw.lcd.width: 2048
hw.initialOrientation: landscape
image.androidVersion.api: 28
tag.id: google_apis
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Nexus 9 API 28
hw.gpu.mode: host
hw.ramSize: 1536
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.cpu.ncore: 2
hw.keyboard: yes
hw.sensors.proximity: no
hw.dPad: no
hw.lcd.height: 1536
vm.heapSize: 192
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-28/google_apis/x86/
showDeviceFrame: yes
hw.camera.back: webcam0
AvdId: Nexus_9_API_28
hw.lcd.density: 320
hw.arc: false
hw.device.hash2: MD5:1d017f4d8ab4265c9a5118f248f36f04
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google APIs
runtime.network.latency: none
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
```
App Version: 2.8.0
App Version Code: 75
Files App Version Code: 30090290
---
OS Version: 4.4.124+(5456446)
OS API Level: 28
Device: generic_x86
Model (and Product): Android SDK built for x86 (sdk_gphone_x86)
---
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 553936 bytes
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:160)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.os.TransactionTooLargeException: data parcel size 553936 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:1127)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:4027)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
... 7 more
```
I noticed that there is a similar problem at https://github.com/mkulesh/microMathematics . Perhaps we can refer to this issue to find more context about the bug (e.g. the cause of this bug, or the hint to resolve it?).
Also similar issue here, here, and here. Maybe you can find applicable fixes in the referred PRs in those issues.
App Version: 4.0.0
App Version Code: 40000090
App Flavor: fdroid
Files App Version Code: 30240190
---
OS Version: 4.19.279-perf(23409000)
OS API Level: 33
Device: FP4
Manufacturer: Fairphone
Model (and Product): FP4 (FP4eea)
---
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 823044 bytes
Bundle stats:
androidx.lifecycle.BundlableSavedStateRegistry.key [size=821380]
android:support:activity-result [size=1412]
android:support:fragments [size=819592]
fragment_131d4103-5784-4948-9014-0816074e9285 [size=819172]
state [size=819140]
PersistableBundle stats:
[null]
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:165)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: android.os.TransactionTooLargeException: data parcel size 823044 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:584)
at android.app.IActivityClientController$Stub$Proxy.activityStopped(IActivityClientController.java:1316)
at android.app.ActivityClient.activityStopped(ActivityClient.java:95)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:154)
... 8 more