blob: 28ee8ba129d0c54594542b7555410cfc8c52b20f [file] [log] [blame]
sewardj83abe432002-07-01 08:46:27 +00001
sewardj83abe432002-07-01 08:46:27 +00002Greetings, packaging person! This information is aimed at people
3building binary distributions of Valgrind.
4
sewardjbc39ad22007-12-09 02:24:02 +00005Thanks for taking the time and effort to make a binary distribution of
6Valgrind. The following notes may save you some trouble.
7
8
9-- Do not ship your Linux distro with a completely stripped
10 /lib/ld.so. At least leave the debugging symbol names on -- line
11 number info isn't necessary. If you don't want to leave symbols on
12 ld.so, alternatively you can have your distro install ld.so's
13 debuginfo package by default, or make ld.so.debuginfo be a
14 requirement of your Valgrind RPM/DEB/whatever.
15
16 Reason for this is that Valgrind's Memcheck tool needs to intercept
17 calls to, and provide replacements for, some symbols in ld.so at
18 startup (most importantly strlen). If it cannot do that, Memcheck
19 shows a large number of false positives due to the highly optimised
20 strlen (etc) routines in ld.so. This has caused some trouble in
21 the past. As of version 3.3.0, on some targets (ppc32-linux,
22 ppc64-linux), Memcheck will simply stop at startup (and print an
23 error message) if such symbols are not present, because it is
24 infeasible to continue.
25
26 It's not like this is going to cost you much space. We only need
27 the symbols for ld.so (a few K at most). Not the debug info and
28 not any debuginfo or extra symbols for any other libraries.
sewardj83abe432002-07-01 08:46:27 +000029
30
31-- (Unfortunate but true) When you configure to build with the
32 --prefix=/foo/bar/xyzzy option, the prefix /foo/bar/xyzzy gets
nethercote6bd3ebd2004-08-24 13:56:54 +000033 baked into valgrind. The consequence is that you _must_ install
sewardj83abe432002-07-01 08:46:27 +000034 valgrind at the location specified in the prefix. If you don't,
35 it may appear to work, but will break doing some obscure things,
36 particularly doing fork() and exec().
37
38 So you can't build a relocatable RPM / whatever from Valgrind.
39
40
sewardjbc39ad22007-12-09 02:24:02 +000041-- Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so
42 in the installation tree. Either Valgrind won't work at all, or it
43 will still work if you do, but will generate less helpful error
44 messages. Here's an example:
sewardj83abe432002-07-01 08:46:27 +000045
46 Mismatched free() / delete / delete []
47 at 0x40043249: free (vg_clientfuncs.c:171)
48 by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)
49 by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)
50 by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)
51 Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd
52 at 0x4004318C: __builtin_vec_new (vg_clientfuncs.c:152)
53 by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)
54 by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)
55 by 0x4C21788F: OLEFilter::convert(QCString const &) (olefilter.cc:272)
56
57 This tells you that some memory allocated with new[] was freed with
sewardjbc39ad22007-12-09 02:24:02 +000058 free().
sewardj83abe432002-07-01 08:46:27 +000059
60 Mismatched free() / delete / delete []
sewardjbc39ad22007-12-09 02:24:02 +000061 at 0x40043249: (inside vgpreload_memcheck.so)
sewardj83abe432002-07-01 08:46:27 +000062 by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)
63 by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)
64 by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)
65 Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd
sewardjbc39ad22007-12-09 02:24:02 +000066 at 0x4004318C: (inside vgpreload_memcheck.so)
sewardj83abe432002-07-01 08:46:27 +000067 by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)
68 by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)
69 by 0x4C21788F: OLEFilter::convert(QCString const &) (olefilter.cc:272)
70
71 This isn't so helpful. Although you can tell there is a mismatch,
72 the names of the allocating and deallocating functions are no longer
73 visible. The same kind of thing occurs in various other messages
74 from valgrind.
75
76
njn801288e2009-08-04 07:02:54 +000077-- Don't strip symbols from lib/valgrind/* in the installation tree.
78 Doing so will likely cause problems. Removing the line number info is
79 probably OK (at least for some of the files in that directory), although
80 that has not been tested by the Valgrind developers.
sewardj83abe432002-07-01 08:46:27 +000081
sewardj83abe432002-07-01 08:46:27 +000082
sewardjbc39ad22007-12-09 02:24:02 +000083-- Please test the final installation works by running it on something
84 huge. I suggest checking that it can start and exit successfully
njn801288e2009-08-04 07:02:54 +000085 both Firefox and OpenOffice.org. I use these as test programs, and I
86 know they fairly thoroughly exercise Valgrind. The command lines to use
87 are:
sewardjbc39ad22007-12-09 02:24:02 +000088
njn801288e2009-08-04 07:02:54 +000089 valgrind -v --trace-children=yes firefox
sewardjbc39ad22007-12-09 02:24:02 +000090
91 valgrind -v --trace-children=yes soffice
sewardj83abe432002-07-01 08:46:27 +000092
93
mueller2b317b52004-01-02 23:11:35 +000094If you find any more hints/tips for packaging, please report
njn272b2162005-05-17 03:22:38 +000095it as a bugreport. See http://www.valgrind.org for details.