Issue 10551 - Crash in new lingucomponent if no thesaurus defined
Summary: Crash in new lingucomponent if no thesaurus defined
Status: CLOSED FIXED
Alias: None
Product: Infrastructure
Classification: Infrastructure
Component: Website general issues (show other issues)
Version: current
Hardware: PC Linux, all
: P1 (highest) Trivial (vote)
Target Milestone: ---
Assignee: khendricks
QA Contact: issues@lingucomponent
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-09 15:49 UTC by chris
Modified: 2013-02-24 20:34 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch against lingucomponent/source/thesaurus/libth/thesimp.cxx in STABLE_1 (653 bytes, patch)
2003-01-09 15:52 UTC, chris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description chris 2003-01-09 15:49: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
Comment 1 chris 2003-01-09 15:52:16 UTC
Created attachment 4252 [details]
Patch against lingucomponent/source/thesaurus/libth/thesimp.cxx in STABLE_1
Comment 2 khendricks 2003-01-10 14:02:34 UTC
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
Comment 3 chris 2003-01-10 14:13:36 UTC
$ 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
Comment 4 khendricks 2003-01-10 14:15:41 UTC
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
Comment 5 khendricks 2003-01-10 14:23:47 UTC
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
Comment 6 chris 2003-02-24 14:19:23 UTC
Verified was released in 1.0.2; closing