online
online copied to clipboard
YEARS-function in calc crashes CollaboraOfficeApp on iPadOS
Describe the bug YEARS-function in calc crashes CollaboraOfficeApp on iPadOS
To Reproduce Steps to reproduce the behavior:
- Create Speadsheet in LibreOffice (or AO) using the YEARS-function
- Save and send file to iPad
- Collabora crashes
Expected behavior Collabora shows speadsheet
Actual behavior Collabora opens for a second and crashes
Screenshots don't have any
** Workaround ** Use DATEDIF-function instead, if you're able to edit the spreadsheet (i can't, because it is protected)
** iPad **
- Device: iPad (8th gen)
- OS: iPadOS 15.6.1
- Browser: none, but App
- Version: 21.11.3.5
Crash confirmed, @tml1024, possibly a necessary library isn't included with the app?
Something like that, probably yes.
I think this is the function that's ultimately called: https://opengrok.libreoffice.org/xref/core/scaddins/source/datefunc/datefunc.cxx?r=dac843c4#544
There was another issue in the past when a function didn't work as expected on iOS, but in that case only the result was wrong #1519.
Interesting. The crash is in the inline assembly in callVirtualMethod() in the C++/UNO bridge. Backtrace:
#0 0x00000001044184e4 in (anonymous namespace)::callVirtualMethod(void*, int, void*, _typelib_TypeDescriptionReference*, unsigned long*, int, unsigned long*, double*) at /Users/tml/lo/co-22.05-ios-debug/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx:150
#1 0x0000000104417c68 in (anonymous namespace)::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) at /Users/tml/lo/co-22.05-ios-debug/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx:357
#2 0x0000000104417260 in ::unoInterfaceProxyDispatch(uno_Interface , const typelib_TypeDescription , void , void , uno_Any ) at /Users/tml/lo/co-22.05-ios-debug/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx:546
#3 0x000000010582b534 in stoc_corefl::(anonymous namespace)::IdlInterfaceMethodImpl::invoke(com::sun::star::uno::Any const&, com::sun::star::uno::Sequencecom::sun::star::uno::Any&) at /Users/tml/lo/co-22.05-ios-debug/stoc/source/corereflection/criface.cxx:672
#4 0x00000001066d72f8 in ScUnoAddInCall::ExecuteCallWithArgs(com::sun::star::uno::Sequencecom::sun::star::uno::Any&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/tool/addincol.cxx:1398
#5 0x00000001066d6f7c in ScUnoAddInCall::ExecuteCall() at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/tool/addincol.cxx:1372
#6 0x0000000106878088 in ScInterpreter::ScExternal() at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/tool/interpr4.cxx:3012
#7 0x000000010687ff80 in ScInterpreter::Interpret() at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/tool/interpr4.cxx:4415
#8 0x0000000106556768 in ScFormulaCell::InterpretTail(ScInterpreterContext&, ScFormulaCell::ScInterpretTailParameter) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/formulacell.cxx:1946
#9 0x00000001065549d0 in ScFormulaCell::Interpret(int, int) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/formulacell.cxx:1616
#10 0x0000000106551f98 in ScFormulaCell::MaybeInterpret() at /Users/tml/lo/co-22.05-ios-debug/sc/inc/formulacell.hxx:465
#11 0x000000010655b9e4 in ScFormulaCell::GetErrCode() at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/formulacell.cxx:2969
#12 0x0000000106718a04 in ScCellFormat::GetString(ScRefCellValue const&, unsigned int, Color const, SvNumberFormatter&, ScDocument const&, bool, bool, bool) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/tool/cellform.cxx:87
#13 0x0000000106202adc in ScColumn::UpdateScriptType(sc::CellTextAttr&, int, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::iterator_trait>&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/column3.cxx:865
#14 0x00000001061d7398 in ScColumn::GetRangeScriptType(mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func1<mdds::mtv::default_element_block<51, sc::CellTextAttr> >, mdds::mtv::default_trait>::iterator_trait>&, int, int, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::iterator_trait> const&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/column2.cxx:2291
#15 0x00000001061d2620 in (anonymous namespace)::FindEditCellsHandler::operator()(unsigned long, ScFormulaCell const) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/column.cxx:3004
#16 0x00000001061d22b8 in std::__1::pair<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::const_iterator, unsigned long> sc::CheckElem<mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>, (anonymous namespace)::FindEditCellsHandler>(mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait> const&, mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::const_iterator const&, unsigned long, unsigned long, (anonymous namespace)::FindEditCellsHandler&) at /Users/tml/lo/co-22.05-ios-debug/sc/inc/mtvfunctions.hxx:148
#17 0x00000001061d1f20 in std::__1::pair<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::const_iterator, mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::size_type> sc::FindElement2<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, (anonymous namespace)::FindEditCellsHandler, (anonymous namespace)::FindEditCellsHandler>(mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait> const&, mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::size_type, mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::size_type, (anonymous namespace)::FindEditCellsHandler&, (anonymous namespace)::FindEditCellsHandler&) at /Users/tml/lo/co-22.05-ios-debug/sc/inc/mtvfunctions.hxx:495
#18 0x00000001061b346c in std::__1::pair<mdds::mtv::soa::detail::const_iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::const_iterator_trait, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait>::iterator_trait> >, unsigned long> sc::FindFormulaEditText<(anonymous namespace)::FindEditCellsHandler>(mdds::mtv::soa::multi_type_vector<mdds::mtv::custom_block_func3<mdds::mtv::default_element_block<52, svl::SharedString>, mdds::mtv::noncopyable_managed_element_block<53, EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell> >, sc::CellStoreTrait> const&, int, int, (anonymous namespace)::FindEditCellsHandler&) at /Users/tml/lo/co-22.05-ios-debug/sc/inc/mtvcellfunc.hxx:140
#19 0x00000001061b3340 in ScColumn::HasEditCells(int, int, int&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/column.cxx:3344
#20 0x00000001061d63e4 in ScColumn::GetOptimalHeight(sc::RowHeightContext&, int, int, unsigned short, int) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/column2.cxx:916
#21 0x0000000106621f80 in (anonymous namespace)::GetOptimalHeightsInColumn(sc::RowHeightContext&, ScColContainer&, int, int, ScProgress, unsigned long) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/table1.cxx:95
#22 0x0000000106621bd0 in ScTable::SetOptimalHeight(sc::RowHeightContext&, int, int, bool, ScProgress, unsigned long) at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/table1.cxx:476
#23 0x00000001062a6f80 in ScDocRowHeightUpdater::update() at /Users/tml/lo/co-22.05-ios-debug/sc/source/core/data/dociter.cxx:2700
#24 0x0000000106b7cc2c in ScXMLImport::endDocument() at /Users/tml/lo/co-22.05-ios-debug/sc/source/filter/xml/xmlimprt.cxx:1434
#25 0x0000000103e88930 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at /Users/tml/lo/co-22.05-ios-debug/sax/source/fastparser/fastparser.cxx:910
#26 0x0000000103e8f558 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at /Users/tml/lo/co-22.05-ios-debug/sax/source/fastparser/fastparser.cxx:1483
#27 0x000000010ce129c8 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) at /Users/tml/lo/co-22.05-ios-debug/xmloff/source/core/xmlimp.cxx:508
#28 0x0000000106bb689c in ScXMLImportWrapper::ImportFromComponent(com::sun::star::uno::Referencecom::sun::star::uno::XComponentContext const&, com::sun::star::uno::Referencecom::sun::star::frame::XModel const&, com::sun::star::xml::sax::InputSource&, rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequencecom::sun::star::uno::Any const&, bool) at /Users/tml/lo/co-22.05-ios-debug/sc/source/filter/xml/xmlwrap.cxx:185
#29 0x0000000106bba5c0 in ScXMLImportWrapper::Import(ImportFlags, ErrCode&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/filter/xml/xmlwrap.cxx:508
#30 0x0000000106e54214 in ScDocShell::LoadXML(SfxMedium, com::sun::star::uno::Referencecom::sun::star::embed::XStorage const&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/ui/docshell/docsh.cxx:494
#31 0x0000000106e5547c in ScDocShell::Load(SfxMedium&) at /Users/tml/lo/co-22.05-ios-debug/sc/source/ui/docshell/docsh.cxx:627
#32 0x00000001084562b4 in SfxObjectShell::LoadOwnFormat(SfxMedium&) at /Users/tml/lo/co-22.05-ios-debug/sfx2/source/doc/objstor.cxx:3172
#33 0x0000000108457098 in SfxObjectShell::DoLoad(SfxMedium) at /Users/tml/lo/co-22.05-ios-debug/sfx2/source/doc/objstor.cxx:687
#34 0x00000001084aa7d4 in SfxBaseModel::load(com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const&) at /Users/tml/lo/co-22.05-ios-debug/sfx2/source/doc/sfxbasemodel.cxx:1923
#35 0x00000001085d2be8 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const&, com::sun::star::uno::Referencecom::sun::star::frame::XFrame const&) at /Users/tml/lo/co-22.05-ios-debug/sfx2/source/view/frmload.cxx:679
#36 0x00000001042c9f24 in framework::LoadEnv::impl_loadContent() at /Users/tml/lo/co-22.05-ios-debug/framework/source/loadenv/loadenv.cxx:1157
#37 0x00000001042c732c in framework::LoadEnv::start() at /Users/tml/lo/co-22.05-ios-debug/framework/source/loadenv/loadenv.cxx:395
#38 0x00000001042c4a28 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const&, com::sun::star::uno::Referencecom::sun::star::frame::XFrame const&, rtl::OUString const&, int, LoadEnvFeatures) at /Users/tml/lo/co-22.05-ios-debug/framework/source/loadenv/loadenv.cxx:300
#39 0x00000001042c3824 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Referencecom::sun::star::frame::XComponentLoader const&, com::sun::star::uno::Referencecom::sun::star::uno::XComponentContext const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const&) at /Users/tml/lo/co-22.05-ios-debug/framework/source/loadenv/loadenv.cxx:168
#40 0x000000010430a3f4 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequencecom::sun::star::beans::PropertyValue const&) at /Users/tml/lo/co-22.05-ios-debug/framework/source/services/desktop.cxx:593
#41 0x000000010883a834 in lo_documentLoadWithOptions(_LibreOfficeKit*, char const*, char const*) at /Users/tml/lo/co-22.05-ios-debug/desktop/source/lib/init.cxx:2603
#42 0x00000001024e2c54 in lok::Office::documentLoad(char const*, char const*) at /Users/tml/lo/co-22.05-ios-debug/include/LibreOfficeKit/LibreOfficeKit.hxx:901
#43 0x00000001024e0134 in Document::load(std::__1::shared_ptr<ChildSession> const&, std::__1::basic_string<char, std::__1::char_traits
The YEARS function is indeed implemented as a Calc "addin" so it seems that calling such that is broken on iOS.
IMHO it is questionable how useful the "addin" concept is anyway. But presumably removing that (and turning these functions into normal ones in Calc) will not be accepted by the community.
Eike responds:
AddIn functions in general are useful, several extensions use them, so the DateFuncs or ROT13 are good examples how to do it; for the bundled AddIns, the Analysis ones are those that also Excel implemented as however-they-call-addins Analysis-Pack, when exporting to .xls there's some automatism to classify them as macros or such whatever that BIFF needs
I have a fix now that helps in a (non-optimised) debug build. I verified that it doesn't re-introduce #1519. Will check that an optimised build is not broken either.
Yup, fix helps in an optimised build, too. https://gerrit.libreoffice.org/c/core/+/139602 (for co-22.05, will cherry-pick to master and co-2021, too).
This seems to affect the DAYS function as well. Someone told me the app is crashing on their Iphone when they try to open a spreadsheet after I added a function that uses DAYS. I can't test the build myself to confirm the issue but hopefully this is addressed too.
I can confirm that the previous fixes work in the latest TestFlight build. Please close this bug if the bug is fix for you.
I just installed the latest TestFlight build and tested it. The bug is fixed; thanks for that! I'm happily looking forward to seeing the bug fixed in the upcoming regular app store update, thus our students can use it on their iPads (updates are managed by MDM).