Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 14:25:18 +0200
From:      Joan Picanyol i Puig <pica@biaix.org>
To:        Jan Beich <jbeich@FreeBSD.org>
Cc:        office@freebsd.org, Greg Veldman <freebsd@gregv.net>, Li-Wen Hsu <lwhsu@freebsd.org>
Subject:   Re: reproducible crash after libreoffice update
Message-ID:  <20190516122518.GA46018@grummit.biaix.org>
In-Reply-To: <tvdu-mw42-wny@FreeBSD.org>
References:  <20190514115233.GA9791@grummit.biaix.org> <CAKBkRUzCx=h20Jv%2BkocguNByhzPyPA6L8phvrmJgCUvfoqbntQ@mail.gmail.com> <20190514150206.GB11862@grummit.biaix.org> <sgth-m3hq-wny@FreeBSD.org> <20190514175041.GA14247@grummit.biaix.org> <r290-kem8-wny@FreeBSD.org> <20190515075117.GA23790@grummit.biaix.org> <sgtg-apuq-wny@FreeBSD.org> <20190516094425.GA43894@grummit.biaix.org> <tvdu-mw42-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Jan Beich <jbeich@FreeBSD.org> [20190516 14:06]:
> Joan Picanyol i Puig <pica@biaix.org> writes:
> 
> > It does seem that somehow the collator's settings get lost, some more details:
> >
> > (gdb) up 1
> > #1  0x0000000800b5a241 in icu::RuleBasedCollator::doCompare (this=0x8173c41c0, left=0x7fffffffce02 u"pre.conf\xffff", leftLength=8, right=0x7fffffffcdc2 u"parent.conf", 
> >     rightLength=11, errorCode=@0x7fffffffcd94: U_ZERO_ERROR) at rulebasedcollator.cpp:1003
> > 1003        UBool numeric = settings->isNumeric();
> >
> 
> Does the following sample crash?
[snip]
> 
> $ cat a.cc
> #include <unicode/coll.h>
> 
> using namespace icu;
> 
> int main()
> {
>   UErrorCode status = U_ZERO_ERROR; 
>   Collator *coll = Collator::createInstance(Locale("ca", "ES"), status);
>   coll->compare(u"pre.conf\xffff", u"parent.conf");
> 
>   return 0;
> }
> 
> $ c++ a.cc $(icu-config --cppflags --ldflags)
> $ ./a.out

This does not crash.

> 
> > (gdb) up 1
> > #3  0x0000000800b31b39 in icu::Collator::compare (this=0x8173c41c0, source=..., target=...) at coll.cpp:495
> > 495     return (EComparisonResult)compare(source, target, ec);
> > (gdb) print *this
> > $1 = {<icu::UObject> = {<icu::UMemory> = {<No data fields>}, _vptr$UObject = 0x800ce7930 <vtable for icu::RuleBasedCollator+16>}, <No data fields>}
> 
> From the above example:
> 
> (gdb) p *this
> $1 = {<icu::Collator> = {<icu::UObject> = {<icu::UMemory> = {<No data fields>},
>       _vptr$UObject = 0x800658578 <vtable for icu::RuleBasedCollator+16>}, <No data fields>},
>   data = 0x800f21000, settings = 0x800f08000, tailoring = 0x800f01000, cacheEntry = 0x800f50400,
>   validLocale = {<icu::UObject> = {<icu::UMemory> = {<No data fields>},
>       _vptr$UObject = 0x8008d8a80 <vtable for icu::Locale+16>},
>     language = "ca\000\000\000\000\000\000\000\000\000", script = "\000\000\000\000\000",
>     country = "\000\000\000", variantBegin = 2, fullName = 0x800f61058 "ca",
>     fullNameBuffer = "ca", '\000' <repeats 154 times>, baseName = 0x800f61058 "ca", fIsBogus = 0 '\000'},
>   explicitlySetAttributes = 0, actualLocaleIsSameAsValid = 0 '\000'}
> 
> but if "delete coll" happens before coll->compare()
> 
> (gdb) p *this
> $2 = {<icu::UObject> = {<icu::UMemory> = {<No data fields>},
>     _vptr$UObject = 0x800658578 <vtable for icu::RuleBasedCollator+16>}, <No data fields>}
> 
> Did you notice "settings" was lost?

I did notice that settings got lost in my test case. I understand you
suggest that it is because of the caller.

[message reordered]

> If not rebuild libreoffice with debug symbol to get more context.
> Maybe libreoffice "delete" or "ucol_close" UCollator pointer but then
> ends up using it, anyway

Well, that will take a while...

tks
--
joan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190516122518.GA46018>