Bug 124168 - Crash when inserting table of content
Summary: Crash when inserting table of content
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other iOS
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-18 14:51 UTC by Nicolas Christener
Modified: 2019-03-21 23:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Video showing the crash (1.37 MB, video/mp4)
2019-03-18 14:54 UTC, Nicolas Christener
Details
Example document which makes the crash reproducible (586.42 KB, application/vnd.oasis.opendocument.text-template)
2019-03-19 07:29 UTC, Nicolas Christener
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Christener 2019-03-18 14:51:13 UTC
Description:
Inserting a table of content in a document using the iOS app will result in a crash.

Befor the dialog is displayed an error message show up.

(translate from German)

The file "internal/idxexample.odt" could not be found in the path ...

Steps to Reproduce:
1. Create/open a document in the iOS app
2. Try adding a table of content by using the menu entry "Insert > Entry > Table of Contents (Einfügen > Verzeichnis > Verzeichnis... in German version)

Actual Results:
First an error message pops up, when inserting the actual TOC the app crashed

Expected Results:
A TOC should be added to the document


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Nicolas Christener 2019-03-18 14:54:52 UTC
Created attachment 150064 [details]
Video showing the crash
Comment 2 Aron Budea 2019-03-18 23:41:35 UTC
I can't reproduce the crash, but I can see the error message about idxexample.odt not being found.

Additionally, this function currently has limited real world usability on a tablet, as the style selector dropdown is missing from the toolbar, so it's not possible to easily set styles that would get added to the ToC.
Comment 3 Nicolas Christener 2019-03-19 07:29:13 UTC
Created attachment 150093 [details]
Example document which makes the crash reproducible

The attached document results to a crash in my case on 0.1 (22).

1.) Create a document from this template
You can use "http://nicu.winebarrel.ch/tpl/00_index.txt" as template URL in the app settings and instantiate the document from there
2.) Go to page 3, place cursor before the word "Zusammenfassung", add newline, remove number to have an empty lime
3.) Click the menu entry "Insert > Index > Table of Contents" (Einfügen > Verzeichnis > Verzeichnis ... in German)
Comment 4 How can I remove my account? 2019-03-20 17:23:26 UTC
I got a slightly different crash without even invoking any menu entry, after adding a newline in from of the "Zusammenfassung", and hitting backspace twice (to delete both the "2" and "1" section numbers):

Caused by BASIC_DLL being null (naturally, as we don't build any BASIC functionality for iOS) in GetSbxData_Impl():

> #0	0x0000000103d1c82c in std::__1::unique_ptr<BasicDLL::Impl, std::__1::default_delete<BasicDLL::Impl> >::operator->() const [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2567
> #1	0x0000000103d1c82c in GetSbxData_Impl() at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/runtime/basrdll.cxx:109
> #2	0x0000000103d21660 in SbxBase::GetError() at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxbase.cxx:99
> #3	0x0000000103d2c4cc in SbxValue::Put(SbxValues const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxvalue.cxx:425
> #4	0x0000000103d2d790 in SbxValue::PutLong(int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxvalue.cxx:652
> #5	0x0000000107ed6b98 in SwSbxValue::SwSbxValue(long) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/inc/calc.hxx:107
> #6	0x00000001071cc440 in SwCalc::SwCalc(SwDoc&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/bastyp/calc.cxx:230
> #7	0x00000001071cd2b8 in SwCalc::SwCalc(SwDoc&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/bastyp/calc.cxx:240
> #8	0x00000001073a9974 in sw::DocumentFieldsManager::UpdateExpFields(SwTextField*, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/doc/DocumentFieldsManager.cxx:893
> #9	0x0000000107365b34 in sw::DocumentTimerManager::DoIdleJobs(Timer*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/doc/DocumentTimerManager.cxx:190
> #10	0x0000000107364d20 in sw::DocumentTimerManager::LinkStubDoIdleJobs(void*, Timer*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/doc/DocumentTimerManager.cxx:150
> #11	0x0000000108e77fdc in Scheduler::ProcessTaskScheduling() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/scheduler.cxx:447
> #12	0x0000000108e767e8 in Scheduler::CallbackTaskScheduling() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/scheduler.cxx:270
> #13	0x0000000108f93e94 in SalTimer::CallCallback() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/inc/saltimer.hxx:55
> #14	0x0000000108f93c88 in AquaSalInstance::CheckTimeout(bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/headless/svpinst.cxx:207
> #15	0x0000000108f94ebc in AquaSalInstance::DoYield(bool, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/headless/svpinst.cxx:417
> #16	0x0000000108e9ee40 in ImplYield(bool, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:469
> #17	0x0000000108e9e9ac in Application::Yield() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:534
> #18	0x0000000108e9e928 in Application::Execute() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:449
> #19	0x0000000106198444 in desktop::Desktop::Main() at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/app/app.cxx:1642
> #20	0x0000000108eaf768 in ImplSVMain() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svmain.cxx:281
> #21	0x0000000108eb20a8 in SVMain() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svmain.cxx:319
> #22	0x00000001061b8ff4 in ::soffice_main() at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/app/sofficemain.cxx:167
> #23	0x0000000106217e30 in lo_startmain(void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/lib/init.cxx:4371
> #24	0x00000001086ce4ac in osl_thread_start_Impl(void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sal/osl/unx/thread.cxx:234
> #25	0x0000000195a5025c in _pthread_body ()
> #26	0x0000000195a501bc in _pthread_start ()
> #27	0x0000000195a53cf4 in thread_start ()
Comment 5 How can I remove my account? 2019-03-20 17:33:59 UTC
... and when I reproduce exactly, I get a crash then, too, and the top slots in the stack are the same ones, related to BASIC. (Actually I don't remember exactly how much of BASIC functionality we do compile and include in the iOS app. Clearly we do get something as those Sbx* things show up in the stack trace; they are from the basic/source/sbx directory. (The reason we in general have avoided building BASIC, Python, and other potential macro/scripting functionality for iOS is because iOS apps for the App Store are not allowed to be "programmable" according to Apple's rules. At least something like that used to be mentioned, but now when I look at https://developer.apple.com/app-store/review/guidelines/ , I don't actually see it?)

Anyway, the stack trace from the crash corresponding to Nicolas's reproduction instruction is:

> #0	0x0000000103ee082c in std::__1::unique_ptr<BasicDLL::Impl, std::__1::default_delete<BasicDLL::Impl> >::operator->() const [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2567
> #1	0x0000000103ee082c in GetSbxData_Impl() at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/runtime/basrdll.cxx:109
> #2	0x0000000103ee5660 in SbxBase::GetError() at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxbase.cxx:99
> #3	0x0000000103ef04cc in SbxValue::Put(SbxValues const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxvalue.cxx:425
> #4	0x0000000103ef1790 in SbxValue::PutLong(int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/basic/source/sbx/sbxvalue.cxx:652
> #5	0x000000010809ab98 in SwSbxValue::SwSbxValue(long) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/inc/calc.hxx:107
> #6	0x0000000107390440 in SwCalc::SwCalc(SwDoc&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/bastyp/calc.cxx:230
> #7	0x00000001073912b8 in SwCalc::SwCalc(SwDoc&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/bastyp/calc.cxx:240
> #8	0x000000010756d974 in sw::DocumentFieldsManager::UpdateExpFields(SwTextField*, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/doc/DocumentFieldsManager.cxx:893
> #9	0x0000000107e483ec in SwViewShell::CalcLayout() at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/view/viewsh.cxx:1012
> #10	0x0000000107721610 in SwEditShell::CalcLayout() at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/edit/edws.cxx:112
> #11	0x000000010771d5cc in SwEditShell::InsertTableOf(SwTOXBase const&, SfxItemSet const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/core/edit/edtox.cxx:144
> #12	0x00000001083c9214 in SwWrtShell::InsertTableOf(SwTOXBase const&, SfxItemSet const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/uibase/wrtsh/wrtsh2.cxx:332
> #13	0x00000001081a4e04 in SwTOXMgr::UpdateOrInsertTOX(SwTOXDescription const&, SwTOXBase**, SfxItemSet const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/uibase/index/toxmgr.cxx:429
> #14	0x000000010850f8e0 in SwMultiTOXTabDialog::Ok() at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/ui/index/cnttab.cxx:388
> #15	0x0000000105fd652c in SfxTabDialog::OkHdl(Button*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/dialog/tabdlg.cxx:866
> #16	0x0000000105fd3478 in SfxTabDialog::LinkStubOkHdl(void*, Button*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/dialog/tabdlg.cxx:852
> #17	0x0000000108c23330 in Link<Button*, void>::Call(Button*) const at /Volumes/TML13/lo/ios-optimised-cp-6.0/include/tools/link.hxx:84
> #18	0x0000000108c232e8 in Button::Click()::$_0::operator()() const at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/control/button.cxx:125
> #19	0x0000000108c232b0 in decltype(std::__1::forward<Button::Click()::$_0&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<Button::Click()::$_0&>(Button::Click()::$_0&&&) [inlined] at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:4428
> #20	0x0000000108c232a0 in void std::__1::__invoke_void_return_wrapper<void>::__call<Button::Click()::$_0&>(Button::Click()::$_0&&&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__functional_base:349
> #21	0x0000000108c23130 in std::__1::__function::__func<Button::Click()::$_0, std::__1::allocator<Button::Click()::$_0>, void ()>::operator()() at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1562
> #22	0x000000010240530c in std::__1::function<void ()>::operator()() const at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1913
> #23	0x0000000108c365bc in Control::ImplCallEventListenersAndHandler(VclEventId, std::__1::function<void ()> const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/control/ctrl.cxx:314
> #24	0x0000000108c03d6c in Button::Click() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/control/button.cxx:125
> #25	0x0000000108c0d388 in OKButton::Click() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/control/button.cxx:1731
> #26	0x0000000108c0aa70 in PushButton::Tracking(TrackingEvent const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/control/button.cxx:1251
> #27	0x0000000108bbc5ec in vcl::Window::EndTracking(TrackingEventFlags) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/window2.cxx:372
> #28	0x0000000108bf21d0 in ImplHandleMouseEvent(VclPtr<vcl::Window> const&, MouseNotifyEvent, bool, long, long, unsigned long, unsigned short, MouseEventModifiers) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/winproc.cxx:705
> #29	0x0000000108bf6214 in ImplHandleSalMouseButtonUp(vcl::Window*, SalMouseEvent const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/winproc.cxx:1994
> #30	0x0000000108bf520c in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/winproc.cxx:2342
> #31	0x0000000109066630 in Application::PostEventHandler(Application*, void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:953
> #32	0x0000000109065e80 in Application::LinkStubPostEventHandler(void*, void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:911
> #33	0x0000000105f472e0 in Link<void*, void>::Call(void*) const at /Volumes/TML13/lo/ios-optimised-cp-6.0/include/tools/link.hxx:84
> #34	0x0000000108bf81a0 in ImplHandleUserEvent(ImplSVEvent*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/winproc.cxx:1928
> #35	0x0000000108bf57b8 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/winproc.cxx:2478
> #36	0x0000000109152e24 in SalFrame::CallCallback(SalEvent, void const*) const at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/inc/salframe.hxx:275
> #37	0x00000001091582b4 in AquaSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/headless/svpinst.cxx:276
> #38	0x0000000109033d74 in SalUserEventList::DispatchUserEvents(bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/salusereventlist.cxx:109
> #39	0x0000000109158e88 in AquaSalInstance::DoYield(bool, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/headless/svpinst.cxx:413
> #40	0x0000000109062e40 in ImplYield(bool, bool) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:469
> #41	0x00000001090629ac in Application::Yield() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:534
> #42	0x0000000109062928 in Application::Execute() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svapp.cxx:449
> #43	0x000000010635c444 in desktop::Desktop::Main() at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/app/app.cxx:1642
> #44	0x0000000109073768 in ImplSVMain() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svmain.cxx:281
> #45	0x00000001090760a8 in SVMain() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/app/svmain.cxx:319
> #46	0x000000010637cff4 in ::soffice_main() at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/app/sofficemain.cxx:167
> #47	0x00000001063dbe30 in lo_startmain(void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/lib/init.cxx:4371
> #48	0x00000001088924ac in osl_thread_start_Impl(void*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sal/osl/unx/thread.cxx:234
> #49	0x0000000195a5025c in _pthread_body ()
> #50	0x0000000195a501bc in _pthread_start ()
> #51	0x0000000195a53cf4 in thread_start ()
Comment 6 How can I remove my account? 2019-03-20 17:45:07 UTC
Ah, it's section 2.5.2, which says "nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps". As far as I understand, a document (in MSO or ODF formats, at least) can contain forms with GUI elements and BASIC macros that practically turn the document into an app in itself. Whether that matches what section 2.5.2  wants to prohibit I don't know...
Comment 7 Commit Notification 2019-03-20 18:26:38 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/40264372657160b69b9639eff4fe0263af8f9033%5E%21

tdf#124168: We do need the BasicDLL thing also in the iOS app

It will be available in 6.3.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 How can I remove my account? 2019-03-20 18:27:47 UTC
The above fixes the crash. Is in the cp-6.0 branch, too.
Comment 9 Commit Notification 2019-03-20 21:49:29 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/6edbf6015e13a6932fb39db5ad62f34daf96f917%5E%21

tdf#124168: The share/template folder is needed in the iOS app

It will be available in 6.3.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 10 Commit Notification 2019-03-20 21:49:36 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/e0d686af6de6443d2845aa15cac5b2830b5e1dbf%5E%21

tdf#124168: The libctllo.a is needed in the iOS app for ToC

It will be available in 6.3.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 11 Nicolas Christener 2019-03-21 08:02:38 UTC
Fixed in 0.1 (23).

Thanks a lot @Collabora!
Comment 12 Aron Budea 2019-03-21 23:13:46 UTC
Let's use verified status, thanks for retesting Nicolas!