Apache OpenOffice (AOO) Bugzilla – Issue 10551
Crash in new lingucomponent if no thesaurus defined
Last modified: 2013-02-24 20:34:29 UTC
Hi Kevin, On building new 1.0.2 .debs and installing them, I found that oocalc would crash as soon as I selected a cell with any text in. For example: open a new spreadsheet, enter a letter, press down arrow, press up arrow, boom. This was the stack trace: #0 0x44fdb511 in Thesaurus::getLocales() () from /usr/lib/openoffice/program/liblth641li.so #1 0x44fdb667 in Thesaurus::hasLocale(com::sun::star::lang::Locale const&) () from /usr/lib/openoffice/program/liblth641li.so #2 0x441eff2f in ScModule::HasThesaurusLanguage(unsigned short) (nLang=60320) at /usr/local/src/ooffice/openoffice.org-1.0.1/build-tree/oo_1.0.1_src/solver/641/unxlngi4.pro/inc/com/sun/star/uno/Reference.h:260 #3 0x442df1c3 in ScCellShell::GetCellState(SfxItemSet&) () from /usr/lib/openoffice/program/libsc641li.so #4 0x442de5dc in SfxStubScCellShellGetCellState(SfxShell*, SfxItemSet&) () from /usr/lib/openoffice/program/libsc641li.so #5 0x42b1901a in SfxDispatcher::_FillState(SfxSlotServer const&, SfxItemSet&, SfxSlot const*) () from /usr/lib/openoffice/program/libsfx641li.so I found that turing off optimisation would prevent the crash, except that it would then crash in the destructor: #0 0x405881f4 in rtl_freeMemory () from ./libsal.so.3 #1 0x404b527d in operator delete[](void*) () from ./libtl641li.so #2 0x452407d0 in ~Thesaurus (this=0x45129200) at /usr/local/src/ooffice/openoffice.org-1.0.1/build-tree/oo_1.0.1_src/lingucomponent/source/thesaurus/libth/thesimp.cxx:150 #3 0x404666ea in cppu::OWeakObject::release() () from ./libcppuhelper3gcc3.so #4 0x452449bf in cppu::WeakImplHelper5<com::sun::star::linguistic2::XThesaurus, com::sun::star::lang::XInitialization, com::sun::star::lang::XComponent, com::sun::star::lang::XServiceInfo, com::sun::star::lang::XServiceDisplayName>::release() (this=0x44bd67a8) at /usr/local/src/ooffice/openoffice.org-1.0.1/build-tree/oo_1.0.1_src/solver/641/unxlngi4.pro/inc/cppuhelper/implbase5.hxx:164 #5 0x4046e817 in cppu::createStandardClassWithSequence(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::reflection::XIdlClass> const&, com::sun::star::uno::Sequence<rtl::OUString> const&) () from ./libcppuhelper3gcc3.so I traced that to this line: 150 delete[] aCharSetInfo; It seems that memory management of aCharSetInfo is only correct if numthes>0, which if not the case if you upgrade from < 1.0.2 without updating dictionary.lst and adding a THES line, which is exactly what happened to me :) To prevent the crashes, I intitialised all variables that are deleted by the constructor to NULL, so that 'Thesaurus *t = new Thesaurus; delete t;' works correctly when compiled optimised. Also, I allocated memory for aCharSetInfo if numthes==1. Patch is against current STABLE_1. Chris
Created attachment 4252 [details] Patch against lingucomponent/source/thesaurus/libth/thesimp.cxx in STABLE_1
Hi, We just set up issues@lingucompoinent so I did not know this issue was ever here yet! Pleasae assign all spell/hyph.thes issues directly to khendricks@openoffice.org to make sure I see them until we get the new lingucomponent website updated. So I understand the bug and approve your patch. Please commit it to OOO)STABLE_1 and OO643C Thanks for tracking this one down Kevin
$ cvs ci User haggai doesnt have <Commit> access to project whiteboard Sorry, I haven't been given commit access. Could you apply this please? Thanks, Chris
Hi, I am simply no good at using the damn interace to the projects I own. I will try to log in remotely to my machine at home and make the commit. Kevin
Hi, I waqs able to ssh in to my home machine (my dynamic ip changes on me sometime) and make the commit to both OOO_STABLE_1 and OO643C So we should be good to go. I am therefore changing this to fixed. Thanks for all your help Chris! Kevin
Verified was released in 1.0.2; closing