ID:               36884
 Comment by:       egon at inf dot ufpr dot br
 Reported By:      guenther dot unterrainer at gknsintermetals dot com
 Status:           No Feedback
 Bug Type:         Apache related
 Operating System: SLES9 SP3 x86-64
 PHP Version:      4.4.2
 New Comment:

Man, this was very difficult to track down. I spent some hours locating
to problem and trying to isolate it. To me it has nothing to do with
databases or acceletators. Apparently it has to do with a lot of
classes in an array. I'm using
PHP 4.4.2-1build1 on Ubuntu 6.06.
You need to have some high limit on php.ini's memory_limit (to me 512M
was enough). The 'magical' number 16000 on the code above can be
lowered to 3000 to crash my 1GRam machine but I had to increase it to
16000 to crash my 2GRam server.
I have a production server down now because of this, any suggestions?
Downgrading perhaps?
We will be glad to cooperate with more info.
Thanks,


<?php
class Field {
        var $name,$type,$value, $length, $allownull, $description,
$long_description, $validation, $accepted_values, $default_value;
        function Field($name, $type, $length, $allownull, $description,
$default=NULL,$long_description=NULL) {
                $this->name=$name;
                $this->type=$type;
                $this->length=$length;
                $this->allownull=$allownull;
                $this->description=$description;
                $this->long_description=$long_description;
                $this->default_value=$default;
                $this->validation=NULL;
                $this->accepted_values=NULL;
        }
}
class DBObject {
        function DBObject($conn=NULL) {
                $this->setupFields();
                $this->conn=$conn;
                $this->orderby=array();
        }
        function addField($name, $type, $length, $allownull,
$description, $default=NULL,$long_description=NULL) {
                $this->field[$name]["obj"]=new Field($name, $type,
$length, $allownull, $description, $default,$long_description);
        }
}
class SomeTable extends DBObject {
        function setupFields() {
                for ($i=0;$i<26;$i++)
                        $this->addField("field$i", "string", 11, false,
"Some field");
        }
}
function crashMe() {
        $x=new SomeTable(NULL);
        $arr=array();
        for($i=0;$i<16000;$i++) {
                $m=new SomeTable(NULL);
                $arr[]=$m;
        }
        return $arr;
}
crashMe();
echo "I've not crashed?";
?>


Previous Comments:
------------------------------------------------------------------------

[2006-09-14 17:40:07] albertof at barrahome dot org

I got the same error:

*** glibc detected *** free(): invalid pointer: 0x09586360 ***
*** glibc detected *** free(): invalid pointer: 0x099f2360 ***
*** glibc detected *** free(): invalid pointer: 0x0a0f1360 ***


[EMAIL PROTECTED] [/usr/local/apache/conf]# php -v
PHP 4.4.4 (cli) (built: Sep 14 2006 14:21:20)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by
Zend Technologies
    with Zend Optimizer v3.0.0, Copyright (c) 1998-2006, by Zend
Technologies
*** glibc detected *** corrupted double-linked list: 0x09328b90 ***
Aborted (core dumped)
[EMAIL PROTECTED] [/usr/local/apache/conf]#

I solve disabling the Zend Optimizer module.

------------------------------------------------------------------------

[2006-03-28 12:28:25] [EMAIL PROTECTED]

We need a *SHORT* but *COMPLETE* reproduce code.
If you're unable to paste it here - please make as SHORT as you can and
put it somewhere in the net.

------------------------------------------------------------------------

[2006-03-28 12:27:03] guenther dot unterrainer at gknsintermetals dot
com

<?php
$msg = "I tried to explane but your system tells me: Please do not SPAM
our bug system. Is there an other way to comunicate?";
?>

------------------------------------------------------------------------

[2006-03-28 12:23:59] [EMAIL PROTECTED]

No external files please.

------------------------------------------------------------------------

[2006-03-28 12:23:26] [EMAIL PROTECTED]

....with no includes

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/36884

-- 
Edit this bug report at http://bugs.php.net/?id=36884&edit=1

Reply via email to