ID:               38520
 User updated by:  selecter at gmail dot com
 Reported By:      selecter at gmail dot com
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Linux Gentoo 2006.0
 PHP Version:      5.1.5
 New Comment:

I also run x86_64 if it helps


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

[2006-08-20 14:19:21] selecter at gmail dot com

Description:
------------
By method of trial and error I've found the lines of code which cause
php process to crash.

It seems that PDO object's method returns kind of corrupted variable.
It might be related to memory issue.

I tryed to run apache2 -X inside gdb, but after that my php files
weren't processed by php so I could see only the code...

Reproduce code:
---------------
It's hard to paste here some lines that can cause crashing... I'll show
some:

    public function save($username, $prefs){

        $st = $this->db->prepare("UPDATE preferences SET show_email=?,
show_smiles=?, timezone_offset=?, messages_on_page=? WHERE uid=?");

        $st->bindParam(1, $prefs['show_email'], PDO::PARAM_BOOL);

        $st->bindParam(2, $prefs['show_smiles'], PDO::PARAM_BOOL);

        $st->bindParam(3, $prefs['timezone_offset'], PDO::PARAM_INT);

        $st->bindParam(4, $prefs['messages_on_page'], PDO::PARAM_INT);

        $st->bindParam(5, Users::getUserId($this->db, $username),
PDO::PARAM_INT);

        if(($num=$st->execute()) === FALSE){

            SQL::errorHandler($this->db);

        }else{

                $this->session->cacheUserPrefs($prefs);

        }

    }

So... SQL::errorHandler($this->db); passes pdo object to another
method:
   public static function errorHandler($ptr){

        $einfo = $ptr->errorInfo();

        $einfo = $ptr->errorCode.': '.$einfo[2];
        ?><pre><?php        
        debug_print_backtrace();
        ?></pre><?php 
        vardump($einfo); //This causes a crash     
        trigger_error($einfo, E_USER_ERROR); //And this as well if we
comment  the upper line

    }

Actual result:
--------------
[Sun Aug 20 17:15:48 2006] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec2)
[Sun Aug 20 17:15:49 2006] [notice] Digest: generating secret for
digest authentication ...
[Sun Aug 20 17:15:49 2006] [notice] Digest: done
PHP Warning:  PHP Startup: zip: Unable to initialize module\nModule
compiled with module API=20050922, debug=0, thread-safety=0\nPHP   
compiled with module API=20050922, debug=1, thread-safety=0\nThese
options need to match\n in Unknown on line 0
[Sun Aug 20 17:15:49 2006] [warn] pid file /var/run/apache2.pid
overwritten -- Unclean shutdown of previous Apache run?
[Sun Aug 20 17:15:49 2006] [notice] Apache configured -- resuming
normal operations
[Sun Aug 20 17:16:07 2006] [notice] child pid 24211 exit signal
Segmentation fault (11)
[Sun Aug 20 17:16:08 2006] [notice] child pid 24212 exit signal
Segmentation fault (11)


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


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

Reply via email to