blob: b3bac87f673aedfebe0624ce81c935f019c150e4 [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
5Thanks for taking the time and effort to make a binary distribution
6of Valgrind. The following notes may save you some trouble.
7
8
9-- (Unfortunate but true) When you configure to build with the
10 --prefix=/foo/bar/xyzzy option, the prefix /foo/bar/xyzzy gets
11 baked into valgrind.so. The consequence is that you _must_ install
12 valgrind at the location specified in the prefix. If you don't,
13 it may appear to work, but will break doing some obscure things,
14 particularly doing fork() and exec().
15
16 So you can't build a relocatable RPM / whatever from Valgrind.
17
18
19-- Don't strip the debug info off valgrind.so or libpthread.so.
20 Valgrind will still work if you do, but it will generate less
21 helpful error messages. Here's an example:
22
23 Mismatched free() / delete / delete []
24 at 0x40043249: free (vg_clientfuncs.c:171)
25 by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)
26 by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)
27 by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)
28 Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd
29 at 0x4004318C: __builtin_vec_new (vg_clientfuncs.c:152)
30 by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)
31 by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)
32 by 0x4C21788F: OLEFilter::convert(QCString const &) (olefilter.cc:272)
33
34 This tells you that some memory allocated with new[] was freed with
35 free(). If valgrind.so was stripped the message would look like
36 this:
37
38 Mismatched free() / delete / delete []
39 at 0x40043249: (inside valgrind.so)
40 by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)
41 by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)
42 by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)
43 Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd
44 at 0x4004318C: (inside valgrind.so)
45 by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)
46 by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)
47 by 0x4C21788F: OLEFilter::convert(QCString const &) (olefilter.cc:272)
48
49 This isn't so helpful. Although you can tell there is a mismatch,
50 the names of the allocating and deallocating functions are no longer
51 visible. The same kind of thing occurs in various other messages
52 from valgrind.
53
54
sewardj21be1e32002-07-01 10:59:17 +000055-- Try and ensure that the /usr/include/asm/unistd.h file on the
56 build machine contains an entry for all the system calls that
57 the kernels on the target machines can actually support. On my
58 Red Hat 7.2 (kernel 2.4.9) box the highest-numbered entry is
59 #define __NR_fcntl64 221
60 but I have heard of 2.2 boxes where it stops at 179 or so.
61
62 Reason for this is that at build time, support for syscalls
63 is compiled in -- or not -- depending on which of these __NR_*
64 symbols is defined. Problems arise when /usr/include/asm/unistd.h
65 fails to give an entry for a system call which is actually
66 available in the target kernel. In that case, valgrind will
67 abort if asked to handle such a syscall. This is despite the
68 fact that (usually) valgrind's sources actually contain the
69 code to deal with the syscall.
70
71 Several people have reported having this problem. So, please
72 be aware of it. If it's useful, the syscall wrappers are
73 all done in vg_syscall_mem.c; you might want to have a little
74 look in there.
75
76
sewardj83abe432002-07-01 08:46:27 +000077-- Please test the final installation works by running it on
78 something huge. I suggest checking that it can start and
79 exit successfully both Mozilla-1.0 and OpenOffice.org 1.0.
80 I use these as test programs, and I know they fairly thoroughly
81 exercise Valgrind. The command lines to use are:
82
83 valgrind -v --trace-children=yes --workaround-gcc296-bugs=yes mozilla
84
85 valgrind -v --trace-children=yes --workaround-gcc296-bugs=yes soffice
86
87
mueller2b317b52004-01-02 23:11:35 +000088If you find any more hints/tips for packaging, please report
89it as a bugreport. See http://valgrind.kde.org/bugs.html for details.