• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
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 V1.79.1">
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>
25Greetings,�packaging�person!��This�information�is�aimed�at�people<br>
26building�binary�distributions�of�Valgrind.<br>
27<br>
28Thanks�for�taking�the�time�and�effort�to�make�a�binary�distribution�of<br>
29Valgrind.��The�following�notes�may�save�you�some�trouble.<br>
30<br>
31<br>
32--�Do�not�ship�your�Linux�distro�with�a�completely�stripped<br>
33���/lib/ld.so.��At�least�leave�the�debugging�symbol�names�on�--�line<br>
34���number�info�isn't�necessary.��If�you�don't�want�to�leave�symbols�on<br>
35���ld.so,�alternatively�you�can�have�your�distro�install�ld.so's<br>
36���debuginfo�package�by�default,�or�make�ld.so.debuginfo�be�a<br>
37���requirement�of�your�Valgrind�RPM/DEB/whatever.<br>
38<br>
39���Reason�for�this�is�that�Valgrind's�Memcheck�tool�needs�to�intercept<br>
40���calls�to,�and�provide�replacements�for,�some�symbols�in�ld.so�at<br>
41���startup�(most�importantly�strlen).��If�it�cannot�do�that,�Memcheck<br>
42���shows�a�large�number�of�false�positives�due�to�the�highly�optimised<br>
43���strlen�(etc)�routines�in�ld.so.��This�has�caused�some�trouble�in<br>
44���the�past.��As�of�version�3.3.0,�on�some�targets�(ppc32-linux,<br>
45���ppc64-linux),�Memcheck�will�simply�stop�at�startup�(and�print�an<br>
46���error�message)�if�such�symbols�are�not�present,�because�it�is<br>
47���infeasible�to�continue.<br>
48<br>
49���It's�not�like�this�is�going�to�cost�you�much�space.��We�only�need<br>
50���the�symbols�for�ld.so�(a�few�K�at�most).��Not�the�debug�info�and<br>
51���not�any�debuginfo�or�extra�symbols�for�any�other�libraries.<br>
52<br>
53<br>
54--�(Unfortunate�but�true)�When�you�configure�to�build�with�the�<br>
55���--prefix=/foo/bar/xyzzy�option,�the�prefix�/foo/bar/xyzzy�gets<br>
56���baked�into�valgrind.��The�consequence�is�that�you�_must_�install<br>
57���valgrind�at�the�location�specified�in�the�prefix.��If�you�don't,<br>
58���it�may�appear�to�work,�but�will�break�doing�some�obscure�things,<br>
59���particularly�doing�fork()�and�exec().<br>
60<br>
61���So�you�can't�build�a�relocatable�RPM�/�whatever�from�Valgrind.<br>
62<br>
63<br>
64--�Don't�strip�the�debug�info�off�lib/valgrind/$platform/vgpreload*.so<br>
65���in�the�installation�tree.��Either�Valgrind�won't�work�at�all,�or�it<br>
66���will�still�work�if�you�do,�but�will�generate�less�helpful�error<br>
67���messages.��Here's�an�example:<br>
68<br>
69���Mismatched�free()�/�delete�/�delete�[]<br>
70������at�0x40043249:�free�(vg_clientfuncs.c:171)<br>
71������by�0x4102BB4E:�QGArray::~QGArray(void)�(tools/qgarray.cpp:149)<br>
72������by�0x4C261C41:�PptDoc::~PptDoc(void)�(include/qmemarray.h:60)<br>
73������by�0x4C261F0E:�PptXml::~PptXml(void)�(pptxml.cc:44)<br>
74������Address�0x4BB292A8�is�0�bytes�inside�a�block�of�size�64�alloc'd<br>
75������at�0x4004318C:�__builtin_vec_new�(vg_clientfuncs.c:152)<br>
76������by�0x4C21BC15:�KLaola::readSBStream(int)�const�(klaola.cc:314)<br>
77������by�0x4C21C155:�KLaola::stream(KLaola::OLENode�const�*)�(klaola.cc:416)<br>
78������by�0x4C21788F:�OLEFilter::convert(QCString�const�&amp;)�(olefilter.cc:272)<br>
79<br>
80���This�tells�you�that�some�memory�allocated�with�new[]�was�freed�with<br>
81���free().<br>
82<br>
83���Mismatched�free()�/�delete�/�delete�[]<br>
84������at�0x40043249:�(inside�vgpreload_memcheck.so)<br>
85������by�0x4102BB4E:�QGArray::~QGArray(void)�(tools/qgarray.cpp:149)<br>
86������by�0x4C261C41:�PptDoc::~PptDoc(void)�(include/qmemarray.h:60)<br>
87������by�0x4C261F0E:�PptXml::~PptXml(void)�(pptxml.cc:44)<br>
88������Address�0x4BB292A8�is�0�bytes�inside�a�block�of�size�64�alloc'd<br>
89������at�0x4004318C:�(inside�vgpreload_memcheck.so)<br>
90������by�0x4C21BC15:�KLaola::readSBStream(int)�const�(klaola.cc:314)<br>
91������by�0x4C21C155:�KLaola::stream(KLaola::OLENode�const�*)�(klaola.cc:416)<br>
92������by�0x4C21788F:�OLEFilter::convert(QCString�const�&amp;)�(olefilter.cc:272)<br>
93<br>
94���This�isn't�so�helpful.��Although�you�can�tell�there�is�a�mismatch,�<br>
95���the�names�of�the�allocating�and�deallocating�functions�are�no�longer<br>
96���visible.��The�same�kind�of�thing�occurs�in�various�other�messages�<br>
97���from�valgrind.<br>
98<br>
99<br>
100--�Don't�strip�symbols�from�lib/valgrind/*�in�the�installation�tree.<br>
101���Doing�so�will�likely�cause�problems.��Removing�the�line�number�info�is<br>
102���probably�OK�(at�least�for�some�of�the�files�in�that�directory),�although<br>
103���that�has�not�been�tested�by�the�Valgrind�developers.<br>
104<br>
105<br>
106--�Please�test�the�final�installation�works�by�running�it�on�something<br>
107���huge.��I�suggest�checking�that�it�can�start�and�exit�successfully<br>
108���both�Firefox�and�OpenOffice.org.��I�use�these�as�test�programs,�and�I<br>
109���know�they�fairly�thoroughly�exercise�Valgrind.��The�command�lines�to�use<br>
110���are:<br>
111<br>
112���valgrind�-v�--trace-children=yes�firefox<br>
113<br>
114���valgrind�-v�--trace-children=yes�soffice<br>
115<br>
116<br>
117If�you�find�any�more�hints/tips�for�packaging,�please�report<br>
118it�as�a�bugreport.�See�http://www.valgrind.org�for�details.<br>
119<br>
120����</p></div>
121</div>
122<div>
123<br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
124<tr>
125<td rowspan="2" width="40%" align="left">
126<a accesskey="p" href="dist.readme-developers.html">&lt;&lt;�6.�README_DEVELOPERS</a>�</td>
127<td width="20%" align="center"><a accesskey="u" href="dist.html">Up</a></td>
128<td rowspan="2" width="40%" align="right">�<a accesskey="n" href="dist.readme-s390.html">8.�README.S390�&gt;&gt;</a>
129</td>
130</tr>
131<tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
132</table>
133</div>
134</body>
135</html>
136