Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49962 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25523 invoked from network); 23 Oct 2010 10:31:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2010 10:31:36 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:3124] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/79-04650-589B2CC4 for ; Sat, 23 Oct 2010 06:31:34 -0400 Received: (qmail 97872 invoked by uid 98); 23 Oct 2010 10:31:31 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 ( Clear:RC:1(127.0.0.1):. Processed in 0.039036 secs); 23 Oct 2010 10:31:31 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 23 Oct 2010 10:31:31 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Sat, 23 Oct 2010 05:31:31 -0500 Message-ID: In-Reply-To: <45.B1.08818.7F6C0CC4@pb1.pair.com> References: <45.B1.08818.7F6C0CC4@pb1.pair.com> Date: Sat, 23 Oct 2010 05:31:31 -0500 To: internals@lists.php.net User-Agent: SquirrelMail/1.4.21 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] Intermittent problem: can't write to properties of $this From: ceo@l-i-e.com ("Richard Lynch") On Thu, October 21, 2010 6:04 pm, Tim Steiner wrote: > Greetings, > > I'm currently trying to troubleshoot an intermittent problem on one of > our servers. After some time of running just fine (usually a couple > of > hours), scripts will start throwing the warning "Attempt to assign > property of non-object" when writing to a property of the $this > object. > Once it starts, it seems to keep happening every few requests (with > other requests running as expected). The poster at > http://www.zfforums.com/zend-framework-components-13/core-infrastructure-19/warning-attempt-assign-property-non-object-zend_config-5469.html > seems to be having the same issue. > > I've traced the warning output to line 576 of Zend/zend_execute.c, > which > means that something is happening to the write_property of the object. > At this point, I don't have enough knowledge of the internals to > continue tracking this bug down. Any help would be appreciated. Try dumping out the value of $this or your variable or the moral equivalent in C, and see exactly what it *IS* that you are trying to set a property on... Once you figure that out, you can often realize how you managed to get in this state of existence, or at least start backtracking to see how that value got in there in the first place. It probably is in Userland code, with something that you think should "persist" but actually doesn't... A resource, session data, an object that got destructed and is now GC-ed, etc are the usual suspects. In particular, if you have any register_shutdown_function or destructors on your classes, note that PHP does *NOT* guarantee any particular order of destruction, nor even consistency of the same from request to request. Once your server gets busy, GC may be kicking in more, and objects you think are still "valid" in a destructor probably aren't -- they're halfway torn apart by PHP as it shuts down the script. PS Don't try to use echo in a destructor nor shutdown function. http://php.net/error_log is your friend. -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE