sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 1 | |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 2 | Greetings, packaging person! This information is aimed at people |
| 3 | building binary distributions of Valgrind. |
| 4 | |
| 5 | Thanks for taking the time and effort to make a binary distribution |
| 6 | of 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 |
nethercote | 6bd3ebd | 2004-08-24 13:56:54 +0000 | [diff] [blame] | 11 | baked into valgrind. The consequence is that you _must_ install |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 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 | |
nethercote | 6bd3ebd | 2004-08-24 13:56:54 +0000 | [diff] [blame] | 19 | -- Don't strip the debug info off stage2 or libpthread.so. |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 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 |
nethercote | 6bd3ebd | 2004-08-24 13:56:54 +0000 | [diff] [blame] | 35 | free(). If stage2 was stripped the message would look like this: |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 36 | |
| 37 | Mismatched free() / delete / delete [] |
nethercote | 6bd3ebd | 2004-08-24 13:56:54 +0000 | [diff] [blame] | 38 | at 0x40043249: (inside stage2) |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 39 | by 0x4102BB4E: QGArray::~QGArray(void) (tools/qgarray.cpp:149) |
| 40 | by 0x4C261C41: PptDoc::~PptDoc(void) (include/qmemarray.h:60) |
| 41 | by 0x4C261F0E: PptXml::~PptXml(void) (pptxml.cc:44) |
| 42 | Address 0x4BB292A8 is 0 bytes inside a block of size 64 alloc'd |
nethercote | 6bd3ebd | 2004-08-24 13:56:54 +0000 | [diff] [blame] | 43 | at 0x4004318C: (inside stage2) |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 44 | by 0x4C21BC15: KLaola::readSBStream(int) const (klaola.cc:314) |
| 45 | by 0x4C21C155: KLaola::stream(KLaola::OLENode const *) (klaola.cc:416) |
| 46 | by 0x4C21788F: OLEFilter::convert(QCString const &) (olefilter.cc:272) |
| 47 | |
| 48 | This isn't so helpful. Although you can tell there is a mismatch, |
| 49 | the names of the allocating and deallocating functions are no longer |
| 50 | visible. The same kind of thing occurs in various other messages |
| 51 | from valgrind. |
| 52 | |
| 53 | |
sewardj | 83abe43 | 2002-07-01 08:46:27 +0000 | [diff] [blame] | 54 | -- Please test the final installation works by running it on |
| 55 | something huge. I suggest checking that it can start and |
| 56 | exit successfully both Mozilla-1.0 and OpenOffice.org 1.0. |
| 57 | I use these as test programs, and I know they fairly thoroughly |
| 58 | exercise Valgrind. The command lines to use are: |
| 59 | |
| 60 | valgrind -v --trace-children=yes --workaround-gcc296-bugs=yes mozilla |
| 61 | |
| 62 | valgrind -v --trace-children=yes --workaround-gcc296-bugs=yes soffice |
| 63 | |
| 64 | |
mueller | 2b317b5 | 2004-01-02 23:11:35 +0000 | [diff] [blame] | 65 | If you find any more hints/tips for packaging, please report |
njn | 272b216 | 2005-05-17 03:22:38 +0000 | [diff] [blame^] | 66 | it as a bugreport. See http://www.valgrind.org for details. |