Apache OpenOffice (AOO) Bugzilla – Issue 26634
Integrate valgrind into OOo
Last modified: 2005-08-10 13:49:29 UTC
There are two parts to this request. a) The inclusion of line numbers in the build. b) An option on the script to run OOo with valgrind. This would allow an easier debug for constantly crashing problems. or The ability for the automated tests to run under valgrind in the automated test suite. Can you tell us what you are thinking?
Of course. I admit that the description wasn't exactly specific ;-) Anyway, I'm currently going for variant b with this issue. Have a look at the cws_src680_ooogrind tag, I've already committed some nasty hacks to perform an extra build for sal/rtl/source/alloc.c with FORCE_SYSALLOC defined. The following script then LD_PRELOADs that into soffice, to make valgrind tell you anything sensible: #!/bin/sh export LD_PRELOAD=librtlsysalloc.so valgrind $@ (given that librtlsysalloc is in your path, which I tacidly assume it is in an OOo build environment).
FIxed in cws_src680_ooogrind. Still missing is the script integration (releng).
Created attachment 15133 [details] Wrapper script to LD_PRELOAD alloc interceptor
Attached the wrapper script (basically the same as the version pasted inline, but more elegant to extract).
@mhu: Please verify my changes. It's only two files, sal/util/makefile.mk and sal/rtl/source/makefile.mk.
Hi Thorsten, Well, those makefile.mk's surely do what needs to be done. Nevertheless, I have a couple of comments: (1) both makefile.mk's: in the nested 'if' statements .IF "$(GUI)" == "UNX" .IF "$(OS)" == "LINUX" ... .ENDIF # LINUX .ENDIF # UNX the outer statement is simply redundant, and should be removed. (2) util/makefile.mk: the library name 'librtlsysalloc.so...' does not seem well chosen. (2.1) a library <X> not intended to be used as a link dependency (i.e. not appearing on any 'ld' command line as -l<X>) should not have the 'lib' prefix in it's name). Please ask Ause how to make that working in a makefile where DLLPRE is used otherwise. (2.2) 'rtlsysalloc' does not use the 'sal' prefix, but a 'rtl' prefix (everybody seems to like that prefix, which might induce a naming conflict). How about 'salalloc_malloc' (or similar) ? (3) the shared library misses a 'mapfile' to define it's public interface, i.e. the five 'rtl_<x>Memory()' functions. I would name it 'salalloc.map' (as any 'salalloc_<X>' implementation would export the same interface). Hope that helps, Matthias
@mhu: Thanks for the review, will adapt the makefiles accordingly.
Created attachment 15843 [details] Updated shell script
Except for the lib prefix, requested changes are committed (and also reflected in the shell script).
.
Verified.
Reopened, need to have script made available in build environment.
Hi Ause, would you please copy the ooogrind.sh script somewhere into the environment (linux only is sufficient). It's the second attachment of this issue.
set target milestone OOo-later, agreed by JJ
script available in SO environment. isn't it usefull for OOo too?
Indeed. Added this script to our http://tools.openoffice.org/debugging/usingvalgrind.sxw valgrind documentation.
Everything should be done by now.
It integrated in OOo2.0 time line (m46), therefore I correct the target milestone to OOo2.0.