Download it now!
Bug 131195 - Android Viewer crashes when pressing back while loading document
Summary: Android Viewer crashes when pressing back while loading document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-07 03:04 UTC by Michael Weghorn
Modified: 2020-04-01 08:00 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 Michael Weghorn 2020-03-07 03:04:39 UTC
With 'master~2020-03-06_23.08.42_LibreOfficeViewer-strippedUIEditing-debug.apk', Android Viewer crashes for the following scenario:

0) uninstall any previous version of the app (to make sure that fontconfig initializes it's cache anew so loading the first doc takes a bit)
1) install the APK and start Android Viewer
2) open top-right menu, select "About" -> "Notice"
3) while document is still being loaded, press the back button

-> crash

Version: 7.0.0.0.alpha0+
Build ID: 9e8839c934da

Further notes: 

1) While it sounds like the scenario described and fixed in [1] ("android: LibreOfficeMainActivity::onStop: Add null check"), the used daily build contains that commit already, so there's another issue in addition.

2) 'adb logcat' output shows this:

03-07 03:55:29.460 28107 28363 I LibreOfficeKit: LibreOfficeKit successfully initialized
03-07 03:55:29.472 28107 28363 I LOKitTileProvider: ====> Loading file '/assets/notice.txt'
03-07 03:55:29.618   298   395 E BufferQueueProducer: [SurfaceView - org.example.libreoffice/org.libreoffice.LibreOfficeMainActivity#0] disconnect: not connected (req=1)
03-07 03:55:29.618 28107 28364 W libEGL  : EGLNativeWindowType 0x920b2808 disconnect failed
03-07 03:55:29.648 28107 28107 I LibreOfficeMainActivity: onStop..
03-07 03:55:29.652 28107 28107 I LOKitTileProvider: cacheDocument: /storage/emulated/0/Android/data/org.example.libreoffice/cache/lo_cached_notice.txt
03-07 03:55:29.658 28107 28107 W LOKitTileProvider: mDocument was null when trying to save cacheDocument: /storage/emulated/0/Android/data/org.example.libreoffice/cache/lo_cached_notice.txt
03-07 03:55:29.663 28107 28107 I LibreOfficeMainActivity: onDestroy..
03-07 03:55:30.363 28107 28377 E libo:sal/osl/unx/file: failed to open /assets/share/config/images_tango.zip
03-07 03:55:30.366 28107 28377 E libo:sal/osl/unx/file: failed to open /assets/share/config/images_colibre.zip
03-07 03:55:30.414 28107 28363 I LOKitTileProvider: ====> mDocument = org.libreoffice.kit.Document@2306a33
03-07 03:55:30.445 28107 28363 I LOKitTileProvider: Reset document size: 12808 x 48656
03-07 03:55:30.446 28107 28363 I LOKitTileProvider: Document parts: 3
03-07 03:55:30.737 28107 28363 I LOKitTileProvider: Document destroyed: /assets/notice.txt
03-07 03:55:30.899 28107 28107 I LibreOffice/androidinst: 
03-07 03:55:30.899 28107 28107 I LibreOffice/androidinst: SalAbort: 'Unknown application error'
03-07 03:55:30.950   540 25330 I WindowManager: WIN DEATH: Window{d59d15 u0 org.example.libreoffice/org.libreoffice.ui.LibreOfficeUIActivity}
03-07 03:55:30.953   540  8007 I ActivityManager: Process org.example.libreoffice (pid 28107) has died: fore TOP

[1] https://gerrit.libreoffice.org/plugins/gitiles/core/+diff/bf331e388845a5d213b40a3894db8ffc6560e1da%5E%21
Comment 1 Michael Weghorn 2020-03-07 03:06:16 UTC
This was originally mentioned on the mailing list:
https://lists.freedesktop.org/archives/libreoffice/2020-March/084640.html

-> setting to NEW myself, since Terrence is the original reporter and I can confirm
Comment 2 Terrence Enger 2020-03-07 14:56:42 UTC
The problem is fixed in daily build
master~2020-03-06_23.08.42_LibreOfficeViewer-strippedUIEditing-debug.apk.
Actually, the document loading is fast enough that it is hard to be
sure that I pressing the back button soon enough, but this is good
enough for me.

I am setting status RESOLVED WORKSFORME. But maybe it is possible to
give credit to commit adbc858d.  What do you think, Michael?
Comment 3 Michael Weghorn 2020-03-09 13:10:33 UTC
(In reply to Terrence Enger from comment #2)
> I am setting status RESOLVED WORKSFORME. But maybe it is possible to
> give credit to commit adbc858d.  What do you think, Michael?

Since the commit does not really fix the underlying issue, I wouldn't give credit to it.

If I find the time, I still plan to take at least a quick look at what's the root cause. It might be responsible for other (not yet detected) problems.
Comment 4 Michael Weghorn 2020-04-01 07:18:33 UTC
I've taken a look and created this Gerrit change to address the root cause:
https://gerrit.libreoffice.org/c/core/+/91460
Comment 5 Commit Notification 2020-04-01 07:59:46 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/55661298bb3e9087a89a08637e4285f090c4e0e8

tdf#131195 android: Don't destroy doc while loading it

It will be available in 7.0.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.