Issue 26634 - Integrate valgrind into OOo
Summary: Integrate valgrind into OOo
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P4 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: thb
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-17 16:50 UTC by thb
Modified: 2005-08-10 13:49 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Wrapper script to LD_PRELOAD alloc interceptor (229 bytes, text/plain)
2004-05-10 18:27 UTC, thb
no flags Details
Updated shell script (237 bytes, text/plain)
2004-06-11 19:46 UTC, thb
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description thb 2004-03-17 16:50:45 UTC
Integrate valgrind into OOo
Comment 1 foskey 2004-03-18 09:37:50 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?
Comment 2 thb 2004-03-18 19:21:26 UTC
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).
Comment 3 thb 2004-05-04 12:34:33 UTC
FIxed in cws_src680_ooogrind. Still missing is the script integration (releng).
Comment 4 thb 2004-05-10 18:27:45 UTC
Created attachment 15133 [details]
Wrapper script to LD_PRELOAD alloc interceptor
Comment 5 thb 2004-05-10 18:29:47 UTC
Attached the wrapper script (basically the same as the version pasted inline,
but more elegant to extract).
Comment 6 thb 2004-05-10 18:31:59 UTC
@mhu: Please verify my changes. It's only two files, sal/util/makefile.mk and
sal/rtl/source/makefile.mk.
Comment 7 matthias.huetsch 2004-05-11 11:27:14 UTC
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
Comment 8 thb 2004-05-11 11:40:14 UTC
@mhu: Thanks for the review, will adapt the makefiles accordingly.
Comment 9 thb 2004-06-11 19:46:39 UTC
Created attachment 15843 [details]
Updated shell script
Comment 10 thb 2004-06-11 19:47:31 UTC
Except for the lib prefix, requested changes are committed (and also reflected
in the shell script).
Comment 11 thb 2004-06-21 15:33:35 UTC
.
Comment 12 thb 2004-06-21 15:34:13 UTC
Verified.
Comment 13 thb 2004-06-25 19:52:26 UTC
Reopened, need to have script made available in build environment.
Comment 14 thb 2004-06-25 19:53:58 UTC
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.
Comment 15 hans_werner67 2004-08-09 08:36:55 UTC
set target milestone OOo-later, agreed by JJ
Comment 16 hjs 2005-01-18 11:23:36 UTC
script available in SO environment. isn't it usefull for OOo too?
Comment 17 thb 2005-01-18 12:45:13 UTC
Indeed. Added this script to our
http://tools.openoffice.org/debugging/usingvalgrind.sxw valgrind documentation.
Comment 18 thb 2005-01-18 12:46:07 UTC
Everything should be done by now.
Comment 19 thorsten.ziehm 2005-08-10 13:49:29 UTC
It integrated in OOo2.0 time line (m46), therefore I correct the target
milestone to OOo2.0.