Hi,
the STL is a powerful tool but it also makes it easy - in the grand old
C/C++ tradition - to shoot one selves in the foot, as we all know. STL
container and algorithm are now pervasive in OOo, so it's about time to
validate the use of STL constructs in OOo to find the hidden problems.
Fortunately the STLport implementation has a powerful debug mode, and
it's easy to use. Since SRC680 m128 it is possible to use the
environment variable USE_STLP_DEBUG to switch on the STLport debug mode.
The most useful part of the STLport debug mode is iterator checking.
Doing the OOo smoke test and some little additional random testing we
already found 14 uses of questionable STL constructs.
Only code paths which are exercised will be tested by the STLport debug
mode, though. So, if you use some obscure parts of OOo, some huge or
uncommon documents and are willing to help make OOo as stable as
possible, here is a good possibility to help. Compile a recent OOo with
the environment USE_STLP_DEBUG set to TRUE and run your documents on it
(well, maybe better copies of them :-). If STLport finds a questionable
STL usage it will throw an assertion and terminate, so you can easily
extract a precise stack trace and fix the problem (or file an issue).
Sone notes:
1) STLport debug mode iterators are no pointers! I've cleaned up all
occurrences of the lazy (and wrong) usages of iterators as pointers in
SRC680 m128, but maybe something new has already crept in. This clean up
also helps with other STL implementations, like the one which comes with
gcc-4.x
2) A complete recompile is necessary, the debug modes renders all
objects with STL constructs binary incompatible
3) The STLport debug mode breaks the complexity assertions of the STL.
Theoretically some operations should be much slower in debug mode than
in product mode. In practice I didn't notice a real slowdown of OOo.
Thanks,
Heiner
Jens-Heiner Rechtien
Technical Lead Release Engineering, StarOffice
OpenOffice Release Engineer
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]