Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting Messages causes crash #6

Closed
biopsin opened this issue Dec 19, 2023 · 19 comments · Fixed by #139
Closed

Exporting Messages causes crash #6

biopsin opened this issue Dec 19, 2023 · 19 comments · Fixed by #139
Labels
bug Something is not working

Comments

@biopsin
Copy link

biopsin commented Dec 19, 2023

Checklist

  • [X ] I can reproduce the bug with the latest version.
  • [X ] I made sure that there are no existing issues - open or closed - to which I could contribute my information to.
  • [ X] I have read the FAQ and my problem isn't listed.
  • [ X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [ X] This issue contains only one bug.
  • [ X] I have read and understood the contribution guidelines.

Describe the bug
Exporting messages generates file with 0kb and application force close/crash

To Reproduce
Open SMS-Messanger and goto settings -> export messages -> select SMS & MMS -> export to any sdcard location

Expected behavior
Export succseeds

Device info (please complete the following information):

  • Model: [Sony pdx203]
  • OS: [Android 11 - Lineageos-18.1 latest selfbuild]
  • Version [5.19.3]

Additional context
Reported at SimpleMobileTools/Simple-SMS-Messenger#806

catlog 2-17 11:23:17.983 27980 27980 D PickerActionHandler: onFinished( [content://com.android.externalstorage.documents/document/7489-9A91%3ABackup%2FSettings%2FSimpleMobileTools%2FMessages_2023_12_17_11_23_15.json]

12-17 11:23:18.008 30867 30867 D CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10194; state: ENABLED
12-17 11:23:18.015 30867 30867 D skia : --- Failed to create image decoder with message 'unimplemented'
12-17 11:23:18.045 1896 1916 W System : A resource failed to call release.
12-17 11:23:18.066 951 951 I QTI PowerHAL: Power setBoost: 0, duration: 0
12-17 11:23:18.066 951 951 I QTI PowerHAL: Power setBoost: 0, duration: 0
12-17 11:23:18.078 27980 27980 D AbstractActionHandler: Loader has finished for: content://com.android.externalstorage.documents/document/7489-9A91%3ABackup%2FSettings%2FSimpleMobileTools
12-17 11:23:18.078 27980 27980 I Model : Updating model with new result set.
12-17 11:23:18.078 27980 27980 D DirectoryFragment: Received model update. Loading=false
12-17 11:23:18.349 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:18.385 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:18.407 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:11.523 0 0 I pm8150b_charger: somc_aicl_irq_handler: IRQ: aicl-done
12-17 11:23:11.528 0 0 I FG : fg_gen4_cl_ok_to_begin: IBAT_FLT thr: 100 val: -13 but ignore this function
12-17 11:23:11.528 0 0 I ALG : cap_learning_update: [SOMC CL][OFF] charge_status:1 bsoc_cp:7271
12-17 11:23:18.444 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:11.540 0 0 W healthd : battery l=76 v=4046 t=24.7 h=2 st=2 c=12207 fc=3464000 cc=6 chg=u
12-17 11:23:18.455 959 959 D illumination-service: 'battery': Color ffffff00, BrMode 0, OnMS 0, OffMS 0, Mode 0
12-17 11:23:11.546 0 0 E leds rgb: rgbcommon_sync_state_store do nothing. same state
12-17 11:23:18.465 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.483 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.514 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.532 30867 31857 W System : A resource failed to call release.
12-17 11:23:18.535 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.551 30867 31904 E CursorWindow: Failed to read row 5, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.571 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.586 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.602 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.619 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.637 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.652 30867 31904 E CursorWindow: Failed to read row 5, column -1 from a CursorWindow which has 6 rows, 17 columns.
12-17 11:23:18.676 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:18.698 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.727 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.752 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.773 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.802 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.843 30867 31904 E CursorWindow: Failed to read row 5, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.857 30867 31904 E CursorWindow: Failed to read row 6, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.872 30867 31904 E CursorWindow: Failed to read row 7, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.886 30867 31904 E CursorWindow: Failed to read row 8, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.903 30867 31904 E CursorWindow: Failed to read row 9, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.931 30867 31904 E CursorWindow: Failed to read row 10, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.949 30867 31904 E CursorWindow: Failed to read row 11, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.966 30867 31904 E CursorWindow: Failed to read row 12, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:18.984 30867 31904 E CursorWindow: Failed to read row 13, column -1 from a CursorWindow which has 14 rows, 17 columns.
12-17 11:23:19.023 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.048 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.063 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.077 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.092 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.114 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.132 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.154 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.168 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.189 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.214 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.232 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.247 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 3 rows, 17 columns.
12-17 11:23:19.272 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.301 30867 31904 I chatty : uid=10194(com.simplemobiletools.smsmessenger) Thread-18 identical 1 line
12-17 11:23:19.333 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.369 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.384 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.415 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.436 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.454 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.477 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.497 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.515 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.536 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.554 30867 31904 E CursorWindow: Failed to read row 5, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.572 30867 31904 E CursorWindow: Failed to read row 6, column -1 from a CursorWindow which has 7 rows, 17 columns.
12-17 11:23:19.614 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.632 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.657 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.679 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 4 rows, 17 columns.
12-17 11:23:19.715 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.744 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.766 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.783 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.818 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.859 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.873 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:19.892 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:19.910 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:19.930 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:19.947 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:19.976 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.002 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.028 1507 1824 W NotificationService: Toast already killed. pkg=com.simplemobiletools.smsmessenger token=android.os.BinderProxy@9335011
12-17 11:23:13.122 0 0 I qcom_rpmh DRV: apps_rsc TCS Busy, retrying RPMH message send: addr=0x30080
12-17 11:23:20.034 951 951 I QTI PowerHAL: Power setBoost: 0, duration: 0
12-17 11:23:20.052 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:20.068 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:20.070 1507 1520 W System : A resource failed to call release.
12-17 11:23:13.170 0 0 I IRQ 5 : no longer affine to CPU7
12-17 11:23:20.071 1507 1520 I chatty : uid=1000(system) FinalizerDaemon identical 5 lines
12-17 11:23:20.072 1507 1520 W System : A resource failed to call release.
12-17 11:23:20.092 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:20.113 30867 31904 I chatty : uid=10194(com.simplemobiletools.smsmessenger) Thread-18 identical 1 line
12-17 11:23:20.132 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:20.149 951 951 I QTI PowerHAL: Power setBoost: 0, duration: 0
12-17 11:23:20.161 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:20.186 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:20.206 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 2 rows, 17 columns.
12-17 11:23:20.236 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.260 30867 31904 E CursorWindow: Failed to read row 1, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.282 30867 31904 E CursorWindow: Failed to read row 2, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.297 30867 31904 E CursorWindow: Failed to read row 3, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.312 30867 31904 E CursorWindow: Failed to read row 4, column -1 from a CursorWindow which has 5 rows, 17 columns.
12-17 11:23:20.341 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:20.385 30867 31904 E CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 17 columns.
12-17 11:23:20.757 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.757 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.766 30867 31904 I ls.smsmessenge: Alloc young concurrent copying GC freed 2112(79KB) AllocSpace objects, 0(0B) LOS objects, 17% free, 116MB/140MB, paused 30us total 8.613ms
12-17 11:23:20.766 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.788 30867 31904 I ls.smsmessenge: Alloc concurrent copying GC freed 7(16KB) AllocSpace objects, 1(26MB) LOS objects, 21% free, 89MB/113MB, paused 26us total 21.693ms
12-17 11:23:20.788 30867 31904 I ls.smsmessenge: Forcing collection of SoftReferences for 104MB allocation
12-17 11:23:20.788 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.802 30867 31904 I ls.smsmessenge: Alloc concurrent copying GC freed 5480(203KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 89MB/113MB, paused 28us total 13.666ms
12-17 11:23:20.802 30867 31904 W ls.smsmessenge: Throwing OutOfMemoryError "Failed to allocate a 109453288 byte allocation with 25165824 free bytes and 102MB until OOM, target footprint 119157176, growth limit 201326592" (VmSize 14045404 kB)
12-17 11:23:20.802 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.802 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.809 30867 31904 I ls.smsmessenge: Alloc young concurrent copying GC freed 4(31KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 89MB/113MB, paused 25us total 7.326ms
12-17 11:23:20.809 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.827 30867 31904 I ls.smsmessenge: Alloc concurrent copying GC freed 4(16KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 89MB/113MB, paused 26us total 17.139ms
12-17 11:23:20.827 30867 31904 I ls.smsmessenge: Forcing collection of SoftReferences for 104MB allocation
12-17 11:23:20.827 30867 31904 I ls.smsmessenge: Starting a blocking GC Alloc
12-17 11:23:20.840 30867 31904 I ls.smsmessenge: Alloc concurrent copying GC freed 5(16KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 89MB/113MB, paused 26us total 13.044ms
12-17 11:23:20.840 30867 31904 W ls.smsmessenge: Throwing OutOfMemoryError "Failed to allocate a 109453288 byte allocation with 25165824 free bytes and 102MB until OOM, target footprint 119157176, growth limit 201326592" (VmSize 14045404 kB)
--------- beginning of crash
12-17 11:23:20.841 30867 31904 E AndroidRuntime: FATAL EXCEPTION: Thread-18
12-17 11:23:20.841 30867 31904 E AndroidRuntime: Process: com.simplemobiletools.smsmessenger, PID: 30867
12-17 11:23:20.841 30867 31904 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 109453288 byte allocation with 25165824 free bytes and 102MB until OOM, target footprint 119157176, growth limit 201326592
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at java.util.Arrays.copyOf(Arrays.java:3257)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.m.a(SourceFile:12)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.f.i(SourceFile:19)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.t(SourceFile:8)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at ib.b1.a(SourceFile:13)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.n(SourceFile:106)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.bumptech.glide.d.p(SourceFile:34)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.p(SourceFile:19)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at d9.u.g(SourceFile:79)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at d9.s.a(SourceFile:19)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.n(SourceFile:106)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.bumptech.glide.d.b0(SourceFile:14)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at ib.o.a(SourceFile:45)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.n(SourceFile:106)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.bumptech.glide.d.b0(SourceFile:14)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at d9.r.h(SourceFile:134)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at d9.p.a(SourceFile:19)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at jb.j.a(SourceFile:687)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.n(SourceFile:106)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.bumptech.glide.d.b0(SourceFile:14)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at ib.o.a(SourceFile:45)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kb.v.n(SourceFile:106)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.bumptech.glide.c.n0(SourceFile:32)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at e8.k0.E(SourceFile:396)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at j.a.d(SourceFile:339)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at n8.o.b(SourceFile:1443)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at n8.o.f(SourceFile:229)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at p1.v.run(SourceFile:20)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923)
12-17 11:23:20.842 1507 7831 W ActivityTaskManager: Force finishing activity com.simplemobiletools.smsmessenger/.activities.SettingsActivity
12-17 11:23:20.842 1507 31911 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
12-17 11:23:20.861 30867 31904 I Process : Sending signal. PID: 30867 SIG: 9
12-17 11:23:13.980 0 0 I binder : undelivered TRANSACTION_COMPLETE
12-17 11:23:13.980 0 0 I binder : undelivered transaction 118411719, process died.
12-17 11:23:20.891 1507 27195 I WindowManager: WIN DEATH: Window{1b89499 u0 com.simplemobiletools.smsmessenger/com.simplemobiletools.smsmessenger.activities.MainActivity}
12-17 11:23:20.891 1507 27195 W InputDispatcher: Attempted to unregister already unregistered input channel '1b89499 com.simplemobiletools.smsmessenger/com.simplemobiletools.smsmessenger.activities.MainActivity (server)'
12-17 11:23:20.891 793 793 I Zygote : Process 30867 exited due to signal 9 (Killed)
12-17 11:23:20.892 1507 2674 I ActivityManager: Process com.simplemobiletools.smsmessenger (pid 30867) has died: fg TOP
12-17 11:23:20.893 1507 1556 I libprocessgroup: Successfully killed process cgroup uid 10194 pid 30867 in 0ms
12-17 11:23:20.895 1507 7275 W WindowManager: Cannot find window which accessibility connection is added to
12-17 11:23:20.895 1507 2017 I WindowManager: WIN DEATH: Window{4bf4f3e u0 com.simplemobiletools.smsmessenger/com.simplemobiletools.smsmessenger.activities.SettingsActivity}
12-17 11:23:20.895 1507 2017 W InputDispatcher: Attempted to unregister already unregistered input channel '4bf4f3e com.simplemobiletools.smsmessenger/com.simplemobiletools.smsmessenger.activities.SettingsActivity (server)'
12-17 11:23:20.902 1507 26240 W WindowManager: Cannot find window which accessibility connection is added to
12-17 11:23:20.908 1507 1547 W ActivityManager: setHasOverlayUi called on unknown pid: 30867
12-17 11:23:20.909 1507 1547 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10194; state: DISABLED
12-17 11:23:20.909 1507 1547 D CompatibilityChangeReporter: Compat change id reported: 135754954; UID 10194; state: ENABLED
12-17 11:23:20.910 1507 1555 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10194; state: ENABLED
12-17 11:23:20.916 1507 1555 I ActivityManager: Start proc 30868:com.simplemobiletools.smsmessenger/u0a194 for top-activity {com.simplemobiletools.smsmessenger/com.simplemobiletools.smsmessenger.activities.MainActivity}
12-17 11:23:20.917 5160 5164 I adbd : jdwp connection from 30868
12-17 11:23:20.927 30868 30868 I ls.smsmessenge: The ClassLoaderContext is a special shared library.
12-17 11:23:20.936 30868 30868 W ls.smsmessenge: JIT profile information will not be recorded: profile file does not exist.
12-17 11:23:20.941 30868 30868 D NetworkSecurityConfig: No Network Security Config specified, using platform default
12-17 11:23:20.941 30868 30868 D NetworkSecurityConfig: No Network Security Config specified, using platform default
12-17 11:23:20.949 1022 1575 W DisplayIdentification: Invalid EDID: ASCII text is not printable.
12-17 11:23:20.949 1022 1575 W DisplayIdentification: Invalid EDID: falling back to serial number due to missing display name.
12-17 11:23:20.949 1022 1575 W DisplayIdentification: Invalid EDID: falling back to ASCII text due to missing serial number.
12-17 11:23:20.950 1022 1575 E DisplayIdentification: Invalid EDID: display name and fallback descriptors are missing.
12-17 11:23:20.954 30868 30868 D AppCompatDelegate: Checking for metadata for AppLocalesMetadataHolderService : Service not found
12-17 11:23:20.991 30868 30868 D skia : --- Failed to create image decoder with message 'unimplemented'
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: QUALCOMM build : 191610ae03, Ic907de5ed0
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Build Date : 09/17/20
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.01
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Local Branch :
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.9.12.10.00.00.582.274
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Remote Branch : NONE
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Reconstruct Branch : NOTHING
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Build Config : S P 10.0.5 AArch64
12-17 11:23:21.009 30868 31930 I AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
12-17 11:23:21.012 30868 31930 I AdrenoGLES-0: PFP: 0x016dd091, ME: 0x00000000
12-17 11:23:21.049 951 951 I QTI PowerHAL: Power setBoost: 0, duration: 0
12-17 11:23:21.113 30868 30868 W Glide : Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
12-17 11:23:14.210 0 0 I IRQ 5 : no longer affine to CPU6
12-17 11:23:21.156 30868 30868 W Glide : Load failed for [] with dimensions [113x113]
12-17 11:23:21.156 30868 30868 W Glide : class com.bumptech.glide.load.engine.GlideException: Failed to load resource
12-17 11:23:21.524 1507 1547 W WindowManager: Unable to start animation, surface is null or no children.
12-17 11:23:21.157 30868 30868 I chatty : uid=10194(com.simplemobiletools.smsmessenger) identical 8 lines
12-17 11:23:21.157 30868 30868 W Glide : Load failed for [] with dimensions [113x113]
12-17 11:23:21.157 30868 30868 W Glide : class com.bumptech.glide.load.engine.GlideException: Failed to load resource
12-17 11:23:22.319 4119 4119 D MyReceiver: ACTION_MONITOR_BATTERY_LEVEL received.
12-17 11:23:22.320 4119 4119 D MyReceiver: min level setting=20; max level setting=80
12-17 11:23:22.320 4119 4119 D MyReceiver: current level=76
12-17 11:23:22.322 4119 4119 D Util : Trigger alarm in 5 seconds
12-17 11:23:26.781 30868 31958 D ProfileInstaller: Skipping profile installation for com.simplemobiletools.smsmessenger
12-17 11:23:27.069 959 959 D illumination-service: 'buttons': Color ff000000, BrMode 0, OnMS 0, OffMS 0, Mode 0

@biopsin biopsin added bug Something is not working needs triage Issue is not yet ready for PR authors to take up labels Dec 19, 2023
@Aga-C Aga-C removed the needs triage Issue is not yet ready for PR authors to take up label Dec 19, 2023
@tom93
Copy link
Contributor

tom93 commented Mar 15, 2024

Looks like it's getting OutOfMemoryError.

@biopsin Are you still interested in debugging this?

@​devs Can we get the deobfuscated stack trace? And what do you think about modifying exportMessages to serialize the JSON directly to the file instead of in-memory (i.e. Json.encodeToStream instead of json.encodeToString)? It should reduce the memory requirement by at least half, but may produce an incomplete (corrupt) file on serialization error.

@naveensingh
Copy link
Member

@tom93 The stack trace is from Simple SMS Messenger:

--------- beginning of crash
12-17 11:23:20.841 30867 31904 E AndroidRuntime: FATAL EXCEPTION: Thread-18
12-17 11:23:20.841 30867 31904 E AndroidRuntime: Process: com.simplemobiletools.smsmessenger, PID: 30867
12-17 11:23:20.841 30867 31904 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 109453288 byte allocation with 25165824 free bytes and 102MB until OOM, target footprint 119157176, growth limit 201326592
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at java.util.Arrays.copyOf(Arrays.java:3257)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.JsonToStringWriter.ensureTotalCapacity(JsonToStringWriter.kt:132)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.JsonToStringWriter.ensureAdditionalCapacity(JsonToStringWriter.kt:125)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.JsonToStringWriter.writeQuoted(JsonToStringWriter.kt:51)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.Composer.printQuoted(Composers.kt:41)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeString(StreamingJsonEncoder.kt:220)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.internal.StringSerializer.serialize(Primitives.kt:160)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.internal.StringSerializer.serialize(Primitives.kt:157)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.Encoder$DefaultImpls.encodeNullableSerializableValue(Encoding.kt:299)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.AbstractEncoder.encodeNullableSerializableValue(AbstractEncoder.java:18)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.AbstractEncoder.encodeNullableSerializableElement(AbstractEncoder.java:90)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeNullableSerializableElement(StreamingJsonEncoder.kt:157)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsPart.write$Self(MmsPart.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsPart$$serializer.serialize(MmsPart.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsPart$$serializer.serialize(MmsPart.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.java:80)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.internal.CollectionLikeSerializer.serialize(CollectionSerializers.kt:69)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.java:80)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsBackup.write$Self(MmsBackup.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsBackup$$serializer.serialize(MmsBackup.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.models.MmsBackup$$serializer.serialize(MmsBackup.kt:9)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.JsonContentPolymorphicSerializer.serialize(JsonContentPolymorphicSerializer.kt:85)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.encoding.AbstractEncoder.encodeSerializableElement(AbstractEncoder.java:80)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.internal.CollectionLikeSerializer.serialize(CollectionSerializers.kt:69)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.StreamingJsonEncoder.encodeSerializableValue(StreamingJsonEncoder.kt:228)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.internal.JsonStreamsKt.encodeByWriter(JsonStreams.kt:28)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at kotlinx.serialization.json.Json.encodeToString(Json.kt:81)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.activities.SettingsActivity$exportMessages$1$1.invoke(SettingsActivity.kt:421)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.activities.SettingsActivity$exportMessages$1$1.invoke(SettingsActivity.kt:124)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.helpers.MessagesReader.getMessagesToExport(MessagesReader.kt:32)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.activities.SettingsActivity$exportMessages$1.invoke(SettingsActivity.kt:124)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.smsmessenger.activities.SettingsActivity$exportMessages$1.invoke(SettingsActivity.kt:122)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at com.simplemobiletools.commons.helpers.ConstantsKt.ensureBackgroundThread$lambda$0(Constants.kt:452)
12-17 11:23:20.841 30867 31904 E AndroidRuntime: at java.lang.Thread.run(Thread.java:923)
12-17 11:23:20.842 1507 7831 W ActivityTaskManager: Force finishing activity com.simplemobiletools.smsmessenger/.activities.SettingsActivity

FYI you can deobfuscate it yourself using the following command once you have created a minified build:

/Path/To/Android/Sdk/cmdline-tools/latest/bin/retrace app/build/outputs/mapping/prepaidRelease/mapping.txt crashlog.txt

@tom93
Copy link
Contributor

tom93 commented Mar 16, 2024 via email

@biopsin
Copy link
Author

biopsin commented Mar 16, 2024

@tom93 shure

tom93 added a commit to tom93/FossifyOrg-Messages that referenced this issue Mar 18, 2024
This significantly reduces memory usage.

(We buffer the OutputStream because kotlinx.serialization flushes its
internal buffers excessively[1]. We also buffer the InputStream for
consistency, even though kotlinx.serialization uses adequate
buffering; there is no performance impact because BufferedInputStream
cascades harmlessly[2].)

Fixes FossifyOrg#6.

[1] https://github.com/Kotlin/kotlinx.serialization/blob/v1.6.3/formats/json/jvmMain/src/kotlinx/serialization/json/internal/JvmJsonStreams.kt#L46
[2] https://github.com/openjdk/jdk/blob/jdk-23%2B14/src/java.base/share/classes/java/io/BufferedInputStream.java#L339
@tom93
Copy link
Contributor

tom93 commented Mar 18, 2024

I wrote a patch: #139.

@biopsin Please test it out. If you don't want to built from source / wait for a project member to build, you can use the following APK that I built myself, but note that I am not a project member so use it at your own risk (discussion):
unofficial-messages-2-foss-debug-for-issue-6.apk.zip

@biopsin
Copy link
Author

biopsin commented Mar 19, 2024

@tom93
Export went successfull, generated a 31.9Mb json file.
Could not test manual importing since after a "clear storage" and opening Messages apk it will auto populate from backup or something..
Edit: I will test importing on my second device when I get home..

tom93 added a commit to tom93/FossifyOrg-Messages that referenced this issue Mar 21, 2024
This significantly reduces memory usage.

(We buffer the OutputStream because kotlinx.serialization flushes its
internal buffers excessively[1]. We also buffer the InputStream for
consistency, even though kotlinx.serialization uses adequate
buffering; there is no performance impact because BufferedInputStream
cascades harmlessly[2].)

The functions encodeToStream() and decodeFromStream() are marked as
experimental, but this is a pretty fundamental use case so surely it
will continue to be supported in the future (maybe with minor
changes).

Fixes FossifyOrg#6.

[1] https://github.com/Kotlin/kotlinx.serialization/blob/v1.6.3/formats/json/jvmMain/src/kotlinx/serialization/json/internal/JvmJsonStreams.kt#L46
[2] https://github.com/openjdk/jdk/blob/jdk-23%2B14/src/java.base/share/classes/java/io/BufferedInputStream.java#L339
@knuxyl
Copy link

knuxyl commented Apr 19, 2024

I can confirm this fixes the issue. Tested exporting on a Pixel 5 and importing on a Pixel 4 and all MMS and SMS were available. Generated archive was ~120MB. It's slow but it works. Please merge the patch #139

@QuestioningEspecialy
Copy link

(...) you can use the following APK that I built myself, but note that I am not a project member so use it at your own risk (discussion): unofficial-messages-2-foss-debug-for-issue-6.apk.zip

@Aga-C
came here from #169 seeking a possible solution
and~, after finding a way around setting it as the new default app just so i can open it (App info > Additional settings in the app), i got an error message when attempting to export 1) SMS & MMS messages, 2) SMS messages, and 3) MMS messages :x
Error: java.lang.SecurityException: Permission Denial: reading com.androi...

Suggestion: add "fix" to the name or something so it doesn't get mistaken for the official app
also, i ran the files and download link through VirusTotal:

@tom93
Copy link
Contributor

tom93 commented May 19, 2024

@QuestioningEspecialy I replied over at #169 (comment). I opened a PR to set a unique app name for debug builds (#171). Re permissions, on stock Android you should get a popup asking to make it the default messaging app; the awkwardness might be a GrapheneOS thing.

@gusr
Copy link

gusr commented Jul 12, 2024

Confirmed here. I tried three versions of Fossify Messenger:

  1. f-droid (version 1.0.1, 2024-02-13)
  2. play store (1.0.1 2024-02-02 / released 2024-04-17)
  3. unofficial-messages-2-foss-debug-for-issue-6.apk.zip

All three versions yield the same results, namely: SMS export works. MMS export gives 0 bytes. SMS+MMS gives 0 bytes.

Tried exporting both to internal memory and to the SD card, neither works. Space is available.

Workaround: Install and use SMS Import / Export from f-droid. Works flawlessly for me, plus it also supports exporting/importing the call log.

@tom93
Copy link
Contributor

tom93 commented Jul 12, 2024

@gusr: It's disappointing that the APK with my patch didn't work for you. Some comments:

  • The patched version uses significantly less memory, but still loads all the messages into RAM and can run out of memory if the backup is too large.
  • If it runs out of memory, it should display the error message "Error: java.lang.OutOfMemoryError: Failed to allocate <n> byte allocation". It will take some time until the error message is shown, and it's only shown for a brief moment, so just wait patiently and keep an eye on the screen. I think a minute should be enough; if nothing happens, leave it running unattended for a few more minutes and then check the output file. (Hopefully in the future there would be proper progress indication.)
  • The patched version tries to delete the output file on error, but the deletion is not completely reliable. So if you see an empty file, it could either mean that the deletion failed or that you didn't wait long enough for the export to complete (hence my suggestion to leave it running for a few minutes).

A couple of questions:

  1. How big are the backups created by the "SMS Import / Export" app?

  2. How much memory (RAM) does your phone have? (You can find out by looking up the model's specs online or using the Developer Options.)

  3. Which Android version are you using?

  4. Are you sure that you are using the APK?
    As @​QuestioningEspecialy pointed out, the launcher looks the same.
    The simplest way to ensure you're using the APK is to first uninstall all the other versions (the messages should be safe, but you'll lose preferences, block numbers etc.).
    If you don't uninstall, then pay attention to the permissions prompt -- when you open a new app it shows a popup asking to make it the default messaging app. So for example, if you have two versions, from Google Play and the APK, and you're not sure which launcher is which, then you can find out as follows: 1. Launching the Google Play version through Google Play (or through the homescreen if you have a custom shortcut) and make it the default. 2. Try one of the launchers. If it opens without prompting it's the Google Play version, and if it prompts to make it the default then it's the other version (from the APK).

Some technical notes on making further improvements:

It's possible to reduce the memory usage to virtually nothing, but it would take more work. The idea is to read the messages one at a time or in chunks, and then encode them and write them to the backup individually. It's not that bad -- we just need to manually write a "[" at the start, then write the messages (encoded individually and manually separated by ","), then write a "]" at the end.

Doing something equivalent for import should also be possible, using decodeToSequence.

@gusr
Copy link

gusr commented Jul 12, 2024

@tom93:

  • There is no indication of failure. In the app the failed export (0 bytes) behaves in exactly the same way as the successful one (SMS export)
  • The empty file is there -- not deleted
  • SMS + MMS export from "SMS Import / Export" is 224 MiB
  • 4 GB of RAM
  • Android 9
  • Yes, I made sure to uninstall each version before trying the next

Thanks for working on this. But would not an option be to just use the code from the working "SMS Import / Export" app? It is FOSS after all, so why not use the working code that is being written and maintained just for this purpose? Just a thought!

Best Regards!

@tom93
Copy link
Contributor

tom93 commented Jul 12, 2024

I suspect your backup just can't fit in memory. SMS Import / Export (sms-ie) uses compression; the uncompressed size will be much larger (edit: nope, see comments below) than 224 MiB (you can check by opening the .zip). For a very rough comparison, I tested on an Android 9 emulator with 1.5 GiB RAM, exporting 295 MiB succeeded while 393 MiB failed (and the file got deleted; I'm not sure why it wasn't deleted for you).

But would not an option be to just use the code from the working "SMS Import / Export" app?

(I'm not a project member, speaking for myself.)

Unfortunately it's not that simple.

The sms-ie app is open source, has a compatible license, and is written in the same programming language. That's all great.
But it's still a lot of work to extract the relevant code and use it from a different app.

I think the most practical approach would be to skim through their source code and look for useful ideas or tricks.
In the case of large file handling, the idea I described earlier should be enough (I skimmed through their code and didn't see anything interesting). I'm sure implementing my idea would be simpler than reusing their code.

If sms-ie wanted to make it easy for others to reuse their code, the way to do that would be for them to publish a library. But building and maintaining a good library takes a lot of effort, and they haven't done that.
So if Fossify wanted to reuse the sms-ie code, the Fossify developers would have to read and understand it, probably modify it, and keep it in sync when sms-ie makes changes (e.g. fix bugs).
That's comparable to the amount of work for maintaining Fossify's existing implementation.

There is also the question of the backup file format. Since sms-ie uses a different format, Fossify would have to either switch to that format (while continuing to support import of backups in the old format), or change sms-ie's code to use Fossify's format.

And looking at the history, the Simple Mobile Tools (Fossify) import/export feature was added just a few months after sms-ie was released, so sms-ie might have been too new at the time.

@gusr
Copy link

gusr commented Jul 12, 2024

Thanks. Yes, factoring the core code from SMS Import / Export into a library seems, from a distance, like the most elegant solution.

Just FYI: Uncompressing the SMS Import / Export zip file in my case yields a "messages.ndjson" file which is 9.5 MiB, and a "data" folder which contains the MMS attachments (mostly images), containing about 750 files, totalling 225 MiB. The full uncompressed directory tree is therefore just 235 MiB; barely larger than the compressed zip, at 224 MiB. The .ndjson file contains plain text; it is not compressed further.

@gusr
Copy link

gusr commented Jul 12, 2024

@tom93
Oh. I tried one more thing. On my new phone, 8 GiB RAM, Android 14, after successfully importing all the messages above, I tried exporting from Fossify Messenger. The results are similar, but not identical, to the 4 GiB RAM, Android 9 phone, namely:

  • SMS export succeeds.
  • MMS export pops up a message saying (translated) "No entries to export found". Then it generates a 0 byte file.

So the only difference to the old phone is the message that pops up, but the MMS export still does not work. Play store version; 1.0.1.

@tom93
Copy link
Contributor

tom93 commented Jul 12, 2024

The full uncompressed directory tree is therefore just 235 MiB; barely larger than the compressed

D'oh. I was thinking that SMS bodies and metadata would compress well, but of course the bulk of the data is going to be MMS attachments, and the common file formats (e.g. jpg) already use compression.

That does make things surprising -- I was able to export a backup of a similar size with only 1.5 GiB RAM. In theory the Fossify backup should be x1.33 larger than the uncompressed sms-ie backup (because Fossify uses base64), and the memory usage will probably be x2 of that (because Java strings use UTF-16; could be less if compact strings are enabled), so the estimated memory usage with the patch is 625 MiB which seems fine for a 4 GiB phone.

MMS export pops up a message saying (translated) "No entries to export found". Then it generates a 0 byte file.

That's probably a separate issue. Can you even view any of the imported MMS messages in the Fossify app? Because that notice means it couldn't find any MMS. (The released version will create an empty file in that case; the patched version should delete the file, but again deletion is unreliable.)


So that's two things that could be investigated. If you'd like to resolve them I suggest you create new issues (and @ me so I'll see them). I'm particularly interested in the export; I'd be happy to build a debug APK that displays more info.

@gusr
Copy link

gusr commented Jul 12, 2024

I guess it is possible that what I am seeing is not a memory issue at all then? Just to answer @tom93's questions in this thread:

  • Yes, I can see the messages that were imported using SMS Import / Export in Fossify Messenger. Both SMS and MMS. I did an extra test just now when I wiped all messages (using the wipe button in SMS Import / Export) and then re-imported them.
  • After this, the result on the Android 14 phone is the same: "No entries to export" + 0 byte file.

However, some imported message threads in Fossify Messenger are stuck in the unread (bold font) state. Reading all the messages in those threads, or explicitly selecting "mark as read" has no effect. Not sure if this means the imported data is corrupted after all, or if this is a separate bug in Fossify Messenger?

Not sure how many separate issues this is, really. Does pop-up message / no message mean entirely different things are happening behind the scenes?

@gusr
Copy link

gusr commented Jul 12, 2024

And finally -- re-exporting the imported messages on the new phone using "SMS Import / Export" again works, and shows the correct number of both SMS and MMS messages, so the messages are really there, including MMS, and the full export -> import -> export path works fine using the "SMS Import / Export" app.

@tom93
Copy link
Contributor

tom93 commented Jul 15, 2024

I built a new debug APK with the following patches:

  • #139 (reduce memory usage during import/export)
  • add debug messages for exceptions that were previously ignored
  • add some debug messages during export
  • add an option to limit the export to 100 SMS + 10 MMS (to help check if the size of the backup is the issue)
  • display progress during import
  • #192 (fix import issue on Android 14 due to subscriptionId); this came up in some other threads (88 (comment), #188) and could be related to the issues you're experiencing

Here it is (usual disclaimer): unofficial-messages-import-export-debug-v1.apk.zip
The code is in tag "build/import-export-debug-v1" of my fork (commits).

Please give that a try and let me know how it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants