Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24276 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36848 invoked by uid 1010); 5 Jul 2006 15:18:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36830 invoked from network); 5 Jul 2006 15:18:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jul 2006 15:18:06 -0000 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 65.111.164.201 danica.alphaweb.net Linux 2.4/2.6 Received: from ([65.111.164.201:58662] helo=danica.alphaweb.net) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 0B/E4-16663-C28DBA44 for ; Wed, 05 Jul 2006 11:18:04 -0400 Received: from 001-736-760.area1.spcsdns.net ([68.26.101.212] helo=OHRLVN4523SG) by danica.alphaweb.net with esmtpsa (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.50) id 1Fy97r-0006ZT-BD; Wed, 05 Jul 2006 11:17:18 -0400 Message-ID: <003d01c6a046$2d594da0$d4651a44@OHRLVN4523SG> To: "Gwynne" Cc: References: <7D65229E-FB18-402B-BFD9-212B7A285C21@skytag.com> Date: Wed, 5 Jul 2006 08:17:28 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Re: Making changes to PG() (php_core_globals) From: pollita@php.net ("Sara Golemon") Did you run `make clean` between making the change and running the build? Files containing PG(track_changes) aren't the only ones you need to change, every PG element past track_changes is now located at a different memory offset from the start of the structure. And if you happen to be running under ZTS, you may even be not allocating enough space for storage which'll result in overruns. -Sara ----- Original Message ----- From: "Gwynne" Newsgroups: php.internals To: Sent: Wednesday, July 05, 2006 4:41 AM Subject: Making changes to PG() (php_core_globals) > The subject line gives a pretty good idea what this question is about. > Yes, I'm well aware of the dangers of making core changes, and I'm only > doing it to give myself a better idea what's going on inside :). In any > case, here's the problem... > > One of the changes I tried to make is changing the type of the > track_errors setting from zend_bool to long. It seems like a simple > enough change: change the type in php_globals.h, update the INI setting > in main.c, update the actual usage of the var in main.c, update my local > INI file to use an integer value. > > But as soon as I did this, my test build started showing leaks from > php_hash_environment() and a crash in php_module_shutdown()- > >php_shutdown_ticks()->zend_llist_destroy(). My only guess as to why > it was happening is that I didn't change a type or expected size > somewhere, but for the life of me I can't figure out where my mistake > was; I haven't seen a harcoded size where sizeof() should be or anything > like that, after poring through main.c, php_variables.c, zend_globals.h, > php_globals.h, and the like. > > I've reverted my source, but I'd still like to know: What did I miss? > TSRM was on (--enable-maintainer-zts), as was --enable-debug, if that > helps. I didn't try it without TSRM; if I can't do it thread-safely, then > I'm not doing it right regardless. > > -- Gwynne, Daughter of the Code > "This whole world is an asylum for the incurable."