[Libreoffice] [PATCH] libstdc++ STL debug

Michael Stahl mst at openoffice.org
Thu Sep 15 13:15:19 PDT 2011


On 15.09.2011 16:34, Caolán McNamara wrote:
> On Thu, 2011-09-15 at 14:34 +0200, Michael Stahl wrote:
>> of course what also needs to be prevented is linking against system
>> libraries that expose STL in their interface; a quick search found me
>> cppunit and graphite; the mozilla/nss stuff doesn't seem to expose STL.
> 
> This is basically the scenario that caused the trouble. Its not
> incompatibility between debugging stl in one of our modules vs another
> one but incompatibility between, in practice, non-debugging system
> cppunit and debugging stl in our code, i.e. stuff that uses cppunit
> headers, runs the debugging-stl destructors on something created by
> non-debugging-stl. Inlines resizing/deleting stuff was one problematic
> one IIRC.
> 
> +    # cppunit and graphite expose STL in public headers
> 
> Quite probably need to also handle the mysql connector as well, maybe a
> few more, hunspell ? Gets a bit unwieldy fast to maintain a list in
> configure of stuff that uses stl.

we only have 212 modules so the size of the list is bounded :)

now which of these are external C++ libraries...

* stlport: irrelevant :)

* vigra, mdds, boost: these are by people who don't care about
encapsulation (a.k.a. "header-only" libraries), so no ABI problem

* xpdf, nss, moz, hunspell, mythes: no standard C++ in header (checked by
"grep std unxlngx6/inc/...")

* icu: this seems to use only std::string; guess the internal one needs a
flag, and the system one could be a problem.  strangely when looking at
the OOo icu module there doesn't seem to be anything STLport-related?

oh, wait a second: this page here claims that due to some libstdc++
internal issues the ::std::basic_string is ABI compatible in debug mode,
so "icu" shouldn't be a problem:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt03ch17s04.html

* mysqlcppconn: seems to use iostreams; built with dmake, so problem only
if from system

(by the way, how does it work that building this thing requires some
system mysql libraries? do users need to install those to use mysql? that
seems odd...)

> For the internal cppunit and graphite probably need to pass
> -D_GLIBCXX_DEBUG into *their* build systems as well, no ? The edge-cases
> that needed to be handled seemed to pile up sufficiently high to make it
> hard to know if it was all handled correctly :-(

* graphite: apparently built with dmake, so a problem only if from system

* cppunit: needs flag (already done in the patch), problem if from system

that's all i've found, slightly updated patch attached.  please check if
i've missed anything :)

regards,
 michael
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dbgutil_stl.patch
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110915/9ff8d9b3/attachment.txt>


More information about the LibreOffice mailing list