Apache OpenOffice (AOO) Bugzilla – Issue 20184
Fix problems detected with valgrind
Last modified: 2010-08-25 12:34:23 UTC
Make OOo as "valgrind clean" as possible.
Started.
Fixed: - sal/osl/unx/security.c: overlapping buffers in strncpy() call, no check of return value of sprintf() - vcl/unx/source/app/soicon.cxx: off by one error - desktop/source/app/app.cxx: use of uninitialized variable as in/out parameter in Method call - tools/source/stream/stream.cxx: unchecked return value of a read on a stream - dtrans/source/X11/X11_selection.cxx: uninitialized member of SelectionManager - ucb/source/ucp/file/shell.cxx: use of two uninitialized stack variables in if clause - sal/rtl/source/uuid.cxx: uninitialized members of oslProcessInfo were feeded to random generator - sal/rtl/source/random.c: in two places were uninitialized stack variables/buffers used to enhance the entropy of the random pool
Fixed: - so3/source/misc/factory.cxx: uninitialized members of SoDll - sw/source/core/sw3io/sw3imp.cxx: uninitialied member of Sw3IoImp
Fixed: - xmloff/source/style/xmlbahdl.cxx: feed unitialized value to in/out (5 locations) - xmloff/source/draw/XMLShapeStyleContext.cxx: no check for possibly invalidated (-1)index before using it - sw/source/ui/uiview/view.cxx: methods calls done in ctor before all members are initialized - sw/source/core/txtnode/swfont.cxx: member not in all ctors initialized - sfx2/source/menu/virtmenu.cxx: methods calls done in ctor before all members are initialized
Fixed: - basic/source/comp/symtbl.cxx: uninitialized local variable - psprint/source/printer/jobdata.cxx: returned buffer tailored to size of the memory stream buffer instead of the size of the stream content
Fixed: - sfx2/source/inc/objshimp.hxx: uninitialized member of SfxObjectShell_Impl - unotools/source/ucbhelper/ucblockbytes.cxx: wrote uninitialized buffer to stream
Fixed: - sal/inc/osl/module.hxx: member not in all ctors initialized - sd/source/ui/app/optsitem.cxx: ca. 60 members of several classes not proper initialized - sc/source/ui/docshell/docfunc.cxx: local variable not initialized in one code path - xmloff/source/text/txtexppr.cxx: feed uninitialized value to in/out method parameter
Hi, Adding myself to CC on this. Do you know which versions 680 series or 645 series of builds will see these fixes? I am hoping that they will make it into 1.1.1 or 1.1.2 as well. Nice work! Kevin
I'm mostly through with making the OOo smoketest (without Java) valgrind clean with the default skin (no leak check, though). Only 2 or 3 more contextes to go. It's planned to integrate this stuff in SRC680 sometime in the next weeks, after QA. A few of the fixes have already found their way into 1.1.1, but the majority not. I'm thinking about preparing a patch for the developers to decide if they want to backport certain fixes to OOo 1.1.1. The fixes are small and in general not very risky. Having the OOo smoketest valgrind clean does not mean that everything is fine, of course. But with the bulk of contextes out of the way I'll be able to hand it over to the application developers for a more thorough testing.
Heiner, that's really excellent news. We get a lot of feedback from other folks hacking large C++ apps. From that, it seems the real value in making OOo V-clean by default is twofold: 1. It reduces somewhat the tendency to unrepeatable, occasional crashes. 2. Once it is clean, when tracking down a specific bug, its easy to see if the bug has caused memory corruption, and can save many hours figuring out the root cause. If anything, (2) seems more important than (1). Anyways, keep up the good work.
Hmm, I wouldn't sneer at 1), too :-) In fact about a quarter of the found incidences were plain bugs waiting to jump into the face of the unsuspecting user. The other incidences are serious, too. They wouldn't cause an immediate failure of OOo because of some (un?)lucky coincidences they were hidden behind a logic which always has a valid outcome. Such bugs can be the source of serious regression if things are reworked. We have seen this kind of problem all to often. I haven't yet seen another tool which makes it as easy as valgrind to find this kind of problems.
Fixed: - sw/inc/iodetect.cxx: feed unterminated buffer into method expecting a zero terminated string - sw/source/core/inc/drawfont.hxx: some members of SwDrawTextInfo not initialized - i18n/source/GNUcollator/GNUcollator.cxx: local variable not properly initialized These are my final fixes for valgrind01, it's now smoketest (java tests disabled) clean. I've ignored six more contexts which occur in the run time loader and X11 libraries.
close issue.
Created attachment 70504
Created attachment 71273
Created attachment 71332