Thanks for the reply. Kind of good to know I am not the only one having difficulties. I too have arrays of objects - although had the problem when I was dealing with arrays that were only 2 or 3 items long - and also am passing references quite a bit.
After several hours of going backwards, I seem to be back on the straight and narrow by tweaking my code so i don't read non-existant array elements. Incase this helps anyone else down the road ever, I'll elaborate: I have several object classes which manage arrays of objects. They have member functions which return references to these objects. i.e. function &findObj($id) { return ($this->objarray[$id]); } I realised my problems started when I started passing $id=0 into these functions. No such id exists. I thought this would be fine, because I was expecting to just get NULL back, and I tested against the return value. This did infact work, but seems to have also resulted in all the erratic problems I described in my first post. I have changed the functions to the following form: function &findObj($id) { if ($id) return ($this->objarray[$id]); } and everything seems to be nice and stable again. Maybe somebody who knows the Zend code might be able to work out the cause of these problems? Is this the sort of thing I should send to one of the developer lists? It would be nice to have the time to have a look myself, but my deadline is looming ominously so I need to crack on for now ... thanks again for the response, regards, Martin ----- Original Message ----- From: "Mike Migurski" <[EMAIL PROTECTED]> To: "Martin Peck" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, August 10, 2003 8:57 PM Subject: Re: [PHP] segmentation faults > >I have a large project underway which is (hopefully!) nearing completion, > >running on the latest stable release, 4.3.2. However, strange things > >have started happening... > > > >My main page sometimes causes Apache to seg fault at some point during > >the execution (e.g. [Sun Aug 10 18:05:55 2003] [notice] child pid 29674 > >exit signal Segmentation fault (11)). I thought I'd track through it to > >find out where the problem might be, but having sprinkled a few echo > >statements around it now isn't crashing any more. > > I have also had this problem, and asking about it here provided no help. > > Mine seems to be related to abnormally high numbers of instantiated > objects and large amounts of reference-passing. Occasionally Apache > children will die (with the error you've described), or spin out of > control and hog the CPU for a while (Apache 1.3.27, Red Hat 9, PHP 4.3.2). > I have not been able to track down the problem, though I did attempt to > re-create it using the command-line PHP interpreter to write Apache out of > the picture, and was not able to reproduce the errors. > > I've tried to route around them somewhat, and have been moderately > successful, except when they bump my CPU load to 100%. :-P > > --------------------------------------------------------------------- > michal migurski- contact info and pgp key: > sf/ca http://mike.teczno.com/contact.html > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php