Bug 139350 - Crash when create a new odg,ods,odp file
Summary: Crash when create a new odg,ods,odp file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: ARM Android
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.2.0
Keywords: notBibisectable, regression
Depends on:
Blocks:
 
Reported: 2021-01-01 04:14 UTC by baffclan
Modified: 2021-04-02 12:17 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description baffclan 2021-01-01 04:14:39 UTC
Description:
Cannot create a new Drawing, Spreadsheet, Presentation file.


Steps to Reproduce:
1. Tap a LibreOffice Viwer icon
2. Tap a (+) icon page bottom
3. Tap a New Drawing/New Spreadsheet/New Presentation icon



Actual Results:
LibreOffice Viewer crashes.


Expected Results:
A new odg,ods,odp file will open.


Reproducible: Always


User Profile Reset: No



Additional Info:
Can create New Text Document(odt).


Android-ARM@86-TDF/2020-12-30_23.38.41/
Version: 7.2.0.0.alpha0+
BuildID: 90668f3
https://git.libreoffice.org/core/+log/90668f3
Comment 1 baffclan 2021-01-01 04:50:36 UTC
Move to:
https://github.com/CollaboraOnline/online/issues/1125
Comment 2 baffclan 2021-01-01 05:08:07 UTC
(In reply to baffclan from comment #1)
> Move to:
> https://github.com/CollaboraOnline/online/issues/1125
Sorry Reopend
Comment 3 Michael Weghorn 2021-03-22 11:53:39 UTC
Well, for me the behaviour is slightly different: Creating a new document works for all document types. But it crashes when closing the document in the end.

Setting to NEW anyway, assuming it is the same issue.
Comment 4 Michael Weghorn 2021-03-22 11:56:59 UTC
ADB log contains this (for the Writer case, similar for e.g. Calc):

03-22 12:54:25.009  8795  8795 I LibreOfficeMainActivity: onStop..
03-22 12:54:25.010  8795  8795 I LOKitTileProvider: cacheDocument: /storage/emulated/0/Android/data/org.libreoffice/cache/lo_cached_swriter
03-22 12:54:25.012  8795  8795 D AndroidRuntime: Shutting down VM
03-22 12:54:25.013  8795  8795 E AndroidRuntime: FATAL EXCEPTION: main
03-22 12:54:25.013  8795  8795 E AndroidRuntime: Process: org.libreoffice, PID: 8795
03-22 12:54:25.013  8795  8795 E AndroidRuntime: java.lang.RuntimeException: Unable to stop activity {org.libreoffice/org.libreoffice.LibreOfficeMainActivity}: java.lang.StringIndexOutOfBoundsException: length=0; index=1
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4755)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4726)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4800)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:233)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:216)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7464)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
03-22 12:54:25.013  8795  8795 E AndroidRuntime: Caused by: java.lang.StringIndexOutOfBoundsException: length=0; index=1
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at java.lang.String.substring(String.java:2027)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at org.libreoffice.LOKitTileProvider.cacheDocument(LOKitTileProvider.java:410)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at org.libreoffice.LibreOfficeMainActivity.onStop(LibreOfficeMainActivity.java:518)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1476)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.Activity.performStop(Activity.java:8205)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4747)
03-22 12:54:25.013  8795  8795 E AndroidRuntime:        ... 13 more
03-22 12:54:25.015  1791  1791 E servicemanager: Could not find android.hardware.power.IPower/default in the VINTF manifest.
03-22 12:54:25.018  2247  2599 W ActivityTaskManager:   Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity

(This is with a self-compiled git master as of commit 1bf8f4569502b7900c51f2e238acda6567c96281
Comment 5 Michael Weghorn 2021-03-30 14:48:25 UTC
Pending fix in Gerrit: https://gerrit.libreoffice.org/c/core/+/113376 (and parent commits)
Comment 6 Commit Notification 2021-03-31 04:58:15 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a1abf2c865228e6ed33e99ab73b94357ddbc590f

tdf#139350 android: Add param to allow a "real" "Save As"

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2021-03-31 04:59:25 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2e86226cff95100e3c34d0f22ec5ce6429efb8cb

tdf#139350 android: Fix handling of new docs

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Michael Weghorn 2021-03-31 05:01:53 UTC
(In reply to Michael Weghorn from comment #3)
> Well, for me the behaviour is slightly different: Creating a new document
> works for all document types. But it crashes when closing the document in
> the end.
> 
> Setting to NEW anyway, assuming it is the same issue.

The above commits fix the crashes I saw. Please double-check yours were actually the same. If your crashes still happen with a daily build from tomorrow or newer, please attach an ADB log containing the backtrace.
Comment 9 baffclan 2021-04-02 12:17:42 UTC
Cannot reproduce with new build.

tinderbox: buildname: Android-ARM@86-TDF
tinderbox: tree: MASTER
tinderbox: pull time 2021-04-01 21:30:35
tinderbox: git sha1s
core:b2b892ddb13cd21c031519a6f6ca8d496deaf259

Thanks for fixing this!