debugging with dmalloc
| From: | Swithun Crowe | Date: | Mon, 02 Aug 2004 10:02:27 +0000 |
| Subject: | debugging with dmalloc | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-1065@lists.php.net to get a copy of this message | ||
Hello
I've been tracking down memory leaks in a C++ extension I'm writing for
PHP5 (following J Smith's excellent tutorial). I compiled PHP with
--enable-dmalloc and --enable-debug and have managed to eradicate all
leaks that would get reported after running a script which uses my
extension. But using the dmalloc tool and getting leaks written to a log
file, I've found a whole lot more (which aren't dumped to stderr after
running, say, php -f myscript.php).
Can I assume that these leaks are not coming from PHP, but rather from the
libraries which I'm creating the PHP wrapper for (Sleepycat's DbXml)?
These libraries can't (I don't think) be compiled with dmalloc, so dmalloc
won't be able to tell me the offending line number and file, but just that
some memory was allocated and not freed.
If this is the case, I'll be able to get on to the Sleepycat people and
see if they have any suggestions. But I thought I should try here first.
If anyone can confirm or refute this hypothesis, or has any ideas which
might help, I would be grateful.
Thanks.
Swithun.