Debian Codegraph @

docs/html/dist.readme-packagers.html

raw
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4 <title>7. README_PACKAGERS</title>
5 <link rel="stylesheet" type="text/css" href="vg_basic.css">
6 <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
7 <link rel="home" href="index.html" title="Valgrind Documentation">
8 <link rel="up" href="dist.html" title="Valgrind Distribution Documents">
9 <link rel="prev" href="dist.readme-developers.html" title="6. README_DEVELOPERS">
10 <link rel="next" href="dist.readme-s390.html" title="8. README.S390">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <div><table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"><tr>
14 <td width="22px" align="center" valign="middle"><a accesskey="p" href="dist.readme-developers.html"><img src="images/prev.png" width="18" height="21" border="0" alt="Prev"></a></td>
15 <td width="25px" align="center" valign="middle"><a accesskey="u" href="dist.html"><img src="images/up.png" width="21" height="18" border="0" alt="Up"></a></td>
16 <td width="31px" align="center" valign="middle"><a accesskey="h" href="index.html"><img src="images/home.png" width="27" height="20" border="0" alt="Up"></a></td>
17 <th align="center" valign="middle">Valgrind Distribution Documents</th>
18 <td width="22px" align="center" valign="middle"><a accesskey="n" href="dist.readme-s390.html"><img src="images/next.png" width="18" height="21" border="0" alt="Next"></a></td>
19 </tr></table></div>
20 <div class="chapter">
21 <div class="titlepage"><div><div><h1 class="title">
22 <a name="dist.readme-packagers"></a>7. README_PACKAGERS</h1></div></div></div>
23 <div class="literallayout"><p><br>
24       <br>
25 Greetings, packaging person!  This information is aimed at people<br>
26 building binary distributions of Valgrind.<br>
27 <br>
28 Thanks for taking the time and effort to make a binary distribution of<br>
29 Valgrind.  The following notes may save you some trouble.<br>
30 <br>
31 -- If your toolchain (compiler, linker) support lto, using the configure<br>
32    option --enable-lto=yes will produce a smaller/faster valgrind<br>
33    (up to 10%).<br>
34 <br>
35 -- Do not ship your Linux distro with a completely stripped<br>
36    /lib/ld.so.  At least leave the debugging symbol names on -- line<br>
37    number info isn't necessary.  If you don't want to leave symbols on<br>
38    ld.so, alternatively you can have your distro install ld.so's<br>
39    debuginfo package by default, or make ld.so.debuginfo be a<br>
40    requirement of your Valgrind RPM/DEB/whatever.<br>
41 <br>
42    Reason for this is that Valgrind's Memcheck tool needs to intercept<br>
43    calls to, and provide replacements for, some symbols in ld.so at<br>
44    startup (most importantly strlen).  If it cannot do that, Memcheck<br>
45    shows a large number of false positives due to the highly optimised<br>
46    strlen (etc) routines in ld.so.  This has caused some trouble in<br>
47    the past.  As of version 3.3.0, on some targets (ppc32-linux,<br>
48    ppc64-linux), Memcheck will simply stop at startup (and print an<br>
49    error message) if such symbols are not present, because it is<br>
50    infeasible to continue.<br>
51 <br>
52    It's not like this is going to cost you much space.  We only need<br>
53    the symbols for ld.so (a few K at most).  Not the debug info and<br>
54    not any debuginfo or extra symbols for any other libraries.<br>
55 <br>
56 <br>
57 -- (Unfortunate but true) When you configure to build with the<br>
58    --prefix=/foo/bar/xyzzy option, the prefix /foo/bar/xyzzy gets<br>
59    baked into valgrind.  The consequence is that you _must_ install<br>
60    valgrind at the location specified in the prefix.  If you don't,<br>
61    it may appear to work, but will break doing some obscure things,<br>
62    particularly doing fork() and exec().<br>
63 <br>
64    So you can't build a relocatable RPM / whatever from Valgrind.<br>
65 <br>
66 <br>
67 -- Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so<br>
68    in the installation tree.  Either Valgrind won't work at all, or it<br>
69    will still work if you do, but will generate less helpful error<br>
70    messages.  Here's an example:<br>
71 <br>
72    Mismatched free() / delete / delete []<br>
73       at 0x40043249: free (vg_clientfuncs.c:171)<br>
74       by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)<br>
75       by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)<br>
76       by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)<br>
77       Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd<br>
78       at 0x4004318C: __builtin_vec_new (vg_clientfuncs.c:152)<br>
79       by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)<br>
80       by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)<br>
81       by 0x4C21788F: OLEFilter::convert(QCString const &amp;) (olefilter.cc:272)<br>
82 <br>
83    This tells you that some memory allocated with new[] was freed with<br>
84    free().<br>
85 <br>
86    Mismatched free() / delete / delete []<br>
87       at 0x40043249: (inside vgpreload_memcheck.so)<br>
88       by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149)<br>
89       by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60)<br>
90       by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44)<br>
91       Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd<br>
92       at 0x4004318C: (inside vgpreload_memcheck.so)<br>
93       by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314)<br>
94       by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416)<br>
95       by 0x4C21788F: OLEFilter::convert(QCString const &amp;) (olefilter.cc:272)<br>
96 <br>
97    This isn't so helpful.  Although you can tell there is a mismatch, <br>
98    the names of the allocating and deallocating functions are no longer<br>
99    visible.  The same kind of thing occurs in various other messages <br>
100    from valgrind.<br>
101 <br>
102 <br>
103 -- Don't strip symbols from libexec/valgrind/* in the installation tree.<br>
104    Doing so will likely cause problems.  Removing the line number info is<br>
105    probably OK (at least for some of the files in that directory), although<br>
106    that has not been tested by the Valgrind developers.<br>
107 <br>
108    One consequence of stripping these binaries is that if Valgrind crashes<br>
109    it won't be able to print out a useful callstack. Here is an example<br>
110    posted on Stack Overflow<br>
111 <br>
112       valgrind: the 'impossible' happened: Killed by fatal signal<br>
113 <br>
114       host stacktrace:<br>
115       ==7732== at 0x38091C12: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)<br>
116       ==7732== by 0x38050E84: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)<br>
117       ==7732== by 0x380510A9: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)<br>
118       ==7732== by 0x380D4F7B: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)<br>
119       ==7732== by 0x380E3946: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)<br>
120 <br>
121   Bug reports like this are less likely to be resolved.<br>
122 <br>
123 -- Please test the final installation works by running it on something<br>
124    huge.  I suggest checking that it can start and exit successfully<br>
125    both Firefox and OpenOffice.org.  I use these as test programs, and I<br>
126    know they fairly thoroughly exercise Valgrind.  The command lines to use<br>
127    are:<br>
128 <br>
129    valgrind -v --trace-children=yes firefox<br>
130 <br>
131    valgrind -v --trace-children=yes soffice<br>
132 <br>
133 <br>
134 If you find any more hints/tips for packaging, please report<br>
135 it as a bugreport. See http://www.valgrind.org for details.<br>
136 <br>
137     </p></div>
138 </div>
139 <div>
140 <br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
141 <tr>
142 <td rowspan="2" width="40%" align="left">
143 <a accesskey="p" href="dist.readme-developers.html">&lt;&lt; 6. README_DEVELOPERS</a> </td>
144 <td width="20%" align="center"><a accesskey="u" href="dist.html">Up</a></td>
145 <td rowspan="2" width="40%" align="right"> <a accesskey="n" href="dist.readme-s390.html">8. README.S390 &gt;&gt;</a>
146 </td>
147 </tr>
148 <tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
149 </table>
150 </div>
151 </body>
152 </html>