notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

"TransactionTooLargeException: data parcel size 552920 bytes" with large note on activity lost focus

Open sadr0b0t opened this issue 5 years ago • 10 comments

Hello, I use nextcloud-notes android client 0.24.3 on android 8.

  1. Create new note
  2. Put inside some large enough text
  3. 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.

sadr0b0t avatar Jul 15 '19 17:07 sadr0b0t

How mich data do you have in one note? do you have base64-coded images or such stuff in your notes?

stefan-niedermann avatar Jul 16 '19 05:07 stefan-niedermann

no pictures, just regular text in unicode, 176KB example: https://pastebin.com/7Hn4rmJg (some citations from the book while reading)

sadr0b0t avatar Jul 19 '19 20:07 sadr0b0t

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.

stefan-niedermann avatar Dec 29 '19 22:12 stefan-niedermann

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

sadr0b0t avatar Dec 31 '19 11:12 sadr0b0t

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... 😕

stefan-niedermann avatar Jan 30 '20 12:01 stefan-niedermann

ping @sadr0b0t

stefan-niedermann avatar Feb 07 '20 09:02 stefan-niedermann

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

```

Снимок экрана от 2020-02-09 01-12-02

Снимок экрана от 2020-02-09 01-18-33

sadr0b0t avatar Feb 08 '20 22:02 sadr0b0t

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?).

SylviaLee89 avatar Aug 24 '20 03:08 SylviaLee89

Also similar issue here, here, and here. Maybe you can find applicable fixes in the referred PRs in those issues.

JenniferJohnson89 avatar Aug 24 '20 14:08 JenniferJohnson89

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

rugk avatar May 06 '23 12:05 rugk