Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4256 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47653 invoked by uid 1010); 30 Aug 2003 13:09:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47609 invoked from network); 30 Aug 2003 13:09:27 -0000 Received: from unknown (HELO schnuffel) (213.39.215.161) by pb1.pair.com with SMTP; 30 Aug 2003 13:09:27 -0000 Received: by schnuffel (Postfix, from userid 1000) id AF73C2A869; Sat, 30 Aug 2003 15:09:24 +0200 (CEST) Date: Sat, 30 Aug 2003 15:09:24 +0200 To: Andi Gutmans Cc: internals@lists.php.net Message-ID: <20030830130924.GA20800@thieso.net> References: <5.1.0.14.2.20030830155931.0395a758@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20030830155931.0395a758@127.0.0.1> User-Agent: Mutt/1.5.4i Subject: Re: [PHP-DEV] Problem with CVS From: thies@thiesos.org ("Thies C. Arntzen") On Sat, Aug 30, 2003 at 04:05:42PM +0300, Andi Gutmans wrote: > Hi, > > I've been debugging a problem with my memory manager for quite a while (I > was playing with different block sizes) when I discovered there doesn't > seem to be a bug but the heap gets corrupted by some other place in PHP. It > just happens that the memory manager makes this problem appear sooner. > The problem seems to be in xmlCleanupParser() of the simplexml extension. > Not sure if this is a bug in simplexml or libXML2. > On an empty script I get the following reports from valgrind. Can someone > with a more intimate knowledge of this module or libXML2 please take a > look? (bug.php is an empty script) you are likely to have a buggy version of libXml, that causes this when xmlCleanupParser is called more than once. this happens if two php-modules use libXml and call xmlCleanupParser in the [R|M]SHUTDOWN re, tc > > Thanks, Andi > > [andi@ ~/php5]$ valgrind sapi/cli/php bug.php > ==2074== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. > ==2074== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. > ==2074== Using valgrind-20030725, a program supervision framework for > x86-linux. > ==2074== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. > ==2074== Estimated CPU clock rate is 551 MHz > ==2074== For more details, rerun with: -v > ==2074== > ==2074== Invalid read of size 4 > ==2074== at 0x403A8D4C: __pthread_mutex_destroy (vg_libpthread.c:1010) > ==2074== by 0x40344CFC: xmlFreeMutex (threads.c:138) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== Address 0x418FC32C is 4 bytes inside a block of size 24 free'd > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== > ==2074== Invalid write of size 4 > ==2074== at 0x403A8D69: __pthread_mutex_destroy (vg_libpthread.c:1019) > ==2074== by 0x40344CFC: xmlFreeMutex (threads.c:138) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== Address 0x418FC32C is 4 bytes inside a block of size 24 free'd > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== > ==2074== Invalid write of size 4 > ==2074== at 0x403A8D70: __pthread_mutex_destroy (vg_libpthread.c:1020) > ==2074== by 0x40344CFC: xmlFreeMutex (threads.c:138) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== Address 0x418FC330 is 8 bytes inside a block of size 24 free'd > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== > ==2074== Invalid write of size 4 > ==2074== at 0x403A8D77: __pthread_mutex_destroy (vg_libpthread.c:1021) > ==2074== by 0x40344CFC: xmlFreeMutex (threads.c:138) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== Address 0x418FC334 is 12 bytes inside a block of size 24 free'd > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== > ==2074== Invalid free() / delete / delete[] > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== Address 0x418FC328 is 0 bytes inside a block of size 24 free'd > ==2074== at 0x40025722: free (vg_replace_malloc.c:220) > ==2074== by 0x40344D04: xmlFreeMutex (threads.c:142) > ==2074== by 0x40344189: xmlCleanupGlobals (globals.c:49) > ==2074== by 0x402F7C39: xmlCleanupParser (parser.c:11179) > ==2074== > ==2074== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 4 from 2) > ==2074== malloc/free: in use at exit: 288 bytes in 3 blocks. > ==2074== malloc/free: 3457 allocs, 3455 frees, 513425 bytes allocated. > ==2074== For a detailed leak analysis, rerun with: --leak-check=yes > ==2074== For counts of detected errors, rerun with: -v > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php -- Thies C. Arntzen - Looking for all sorts of freelance work - just ask.. http://www.amazon.de/exec/obidos/wishlist/AB9DY62QWDSZ