ID: 25620 User updated by: xris at farcaster dot net Reported By: xris at farcaster dot net -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: GNU/Linux 2.4.20 PHP Version: 4.3.3 New Comment:
I know that my previous code example would run fine, if being isolated - i just don't know how to home in on the error .. The system is really quite big, for every page are about 40.000 method calls, using classes from hundreds of files (php is really fast ...). The class-framework is highly dependent on each of its parts, so its almost impossible to (easily) only use a simple part of it. The only extension we use are mysql, gd, gettext and pcre. I could try removing mysql/gd calls to see if the problem persist, though. Most of the pages work just fine; i cannot identify anything special about this specific page. As i already mentioned, i encountered this problem some time ago, but was able to work around it by restructuring some parts of the code, so i have a feeling like it might be some kind of garbage collection / memory management problem. Thanks for your efforts- i really have no idea on how to isolate the problem .. i could strip down the system and surely get to a point where the page will work again, but like my previous code example showed, i might not find the real source of the error. Any help on how to proceed would be great. Previous Comments: ------------------------------------------------------------------------ [2003-09-21 15:30:32] [EMAIL PROTECTED] That's unlikely to be causing this. If you ran this simple code in isolation I bet you wouldn't see the error. What else is being called in the script that contains this code? Any non-standard extension calls of any sort? ------------------------------------------------------------------------ [2003-09-21 14:50:07] xris at farcaster dot net Well, just as i guessed, it's very strange. I have been able to isolate a simple piece of code which influences the ocurrence of the Segfault/PHP Warning. Have a look at this code fragement from one of my classes: --- snip --- 1 var_dump( $this->mBuffer); 2 3 if ( $this->mBuffer) { 4 $Client->Buffer( TRUE ); 5 } else { 6 $Client->Buffer( FALSE ); 7 }; 8 9 $Client->Buffer( $this->mBuffer ); ---snip--- The $this->mBuffer object property holds a boolean value (checked via var_dump()). Obviously, line 8 should be equivalent to lines 3-7, but with lines 3-7 in place, the error doesn't show up, while using the statement on line 8, PHP segfaults ... Just in case you ask, the Buffer() method of the client object class is declared as: --- snip --- function Buffer( $Value = TRUE ) { $this->mBuffer = $Value; } --- snip --- How to proceed on isolating the reason for the Error? ------------------------------------------------------------------------ [2003-09-21 11:37:09] [EMAIL PROTECTED] It is natural that an unterminated string bug doesn't always cause a crash, but at the same time, it is also very much related to a specific function call somewhere. For us to have any chance of finding this you need to narrow it down for us. Start commenting out bits of code until the problem goes away, then tell us which piece of code caused it. ------------------------------------------------------------------------ [2003-09-21 11:21:36] xris at farcaster dot net Description: ------------ I run a rather large PHP System (250k+ LOC). Recently, a number of "Segmentation-Faults" started popping up in my Apache error log. Only some of the PHP pages caused a segfault. These segfaults are mostly reproducible, but could be suppressed by moving code around - like changing order of method definitions, etc. So i set up an identical system as our production server, but with --enable debug. The segfaults did not happen anymore, but i keep getting notices like these: [21-Sep-2003 16:25:34] PHP Warning: String is not zero-terminated (SetVerband̏**rtID' aa) (source: /home/develop/mod_php-4.3.3/Zend/zend_opcode.c:165) in Unknown on line 0 The problem occurres with PHP from at least 4.2.2 to 4.3.3, regardless wether running with Apache 1.3x or Apache 2.0. I would like to provide more information, but i don't know how .. any info on how to trace the reason for this problem would greatly appreciated. Reproduce code: --------------- sorry, i'cant construct a small snippted reproducing this error - it seems to pop up on pages with a large amount of used objects, though (but thats only a guess ..) Expected result: ---------------- well, no php crash? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25620&edit=1