php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11261 php segfault in php_rshutdown_pgsql()
Submitted: 2001-06-03 19:26 UTC Modified: 2001-06-04 00:41 UTC
From: arkadi at it dot lv Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.5 OS: FreeBSD 4.3-RC/4.2-STABLE
Private report: No CVE-ID: None
 [2001-06-03 19:26 UTC] arkadi at it dot lv
Apache 1.3.12 DSO with optimization and 1.3.20 static
with debug. 4.0.4pl1 doesn't have this problem.
PostgreSQL 7.0.2 from ports. MySQL 3.22.32 from ports.
PHP configure line:
./configure --with-apache=... \
--with-config-file-path=/usr/local/etc \
--enable-safe-mode \
--enable-calendar \
--with-mysql=/usr/local \
--with-pgsql=/usr/local \
--with-mm \
--with-system-regex \
--enable-debug \
--enable-track-vars \
--with-pdflib \
--with-ttf \
--with-imap=../imap \
--with-gd=../gd
php.ini is pretty generic, changes are related to safe_mode
and other security stuff.

User enter email address to register. Apache succefully
process the request, output valid page, and then segfaults.
The web site is http://www.chrysler.lv/
I've put all related php files and gdb session at
http://kvin.lv/arkadi/tmp/php-pgsql-pr.tgz
Here is the script that cause segfault:

<?php
include('setphp.php3');
$local_connection=mysql_pconnect($mysql_db_host,
$mysql_db_user, $mysql_db_pswd);
mysql_select_db($mysql_db_name, $local_connection);
$email_str='
0123456789abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWYXZ_-@.';
$form_process=1;
if($reg_email==''){
    $form_process=0;
    $err_str ='<font class="font1">J<FB>su e-pasta adres<E7>
ir k<EF><FB>da. L<FB>dzu
izlabojiet to un re<EC>istr<E7>jieties v<E7>lreiz.</font>';
}
if(strpos($reg_email,'@')<=0){
   $form_process=0;
   $err_str ='<font class="font1">J<FB>su e-pasta adres<E7>
ir k<EF><FB>da. L<FB>dzu
izlabojiet to un re<EC>istr<E7>jieties v<E7>lreiz.</font>';
}
if(strpos($reg_email,'.')<=0){
   $form_process=0;
   $err_str ='<font class="font1">J<FB>su e-pasta adres<E7>
ir k<EF><FB>da. L<FB>dzu
izlabojiet to un re<EC>istr<E7>jieties v<E7>lreiz.</font>';
}
for($i=0; $i<strlen($reg_email); $i++){
    
if(strpos($email_str,substr($reg_email,$i,1))<=0){$form_process=0;
        $err_str ='<font class="font1">J<FB>su e-pasta
adres<E7> ir k<EF><FB>da. L<FB>dzu
izlabojiet to un re<EC>istr<E7>jieties v<E7>lreiz.</font>';
        break;
     }
}
if($form_process==1){
        $reg_ip=$REMOTE_ADDR;
        $reg_host=$REMOTE_HOST;
        $mys=mysql_query("insert into reg_emails
                        (email, reg_time, reg_ip,
reg_host,site_id) values
                        ('$reg_email', NOW(), '$reg_ip',
'$reg_host', '$site_id')");
        $err=mysql_error();
        if(isset($err) && $err!=''){$err_str.='<font
class="font1">J<FB>su
e-pasta adres<E7> ir k<EF><FB>da. L<FB>dzu izlabojiet to un
re<EC>istr<E7>jieties v<E7>lreiz.</font>'; }
}
if($err_str!=''){$reg_email_answer=$err_str;}
else{$reg_email_answer='<font class="font1">Paldies! J<FB>s
esat re<EC>istr<E7>jies.</font>';}
include('index.phtml');
?>

It use setphp.php3 that define db/passwd/site_id. It is
called from site main index.phtml.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-04 00:41 UTC] sniper@php.net
This is fixed in PHP 4.0.6. Please try the 
latest release candidate from:

http://www.php.net/~andi/php-4.0.6RC2.tar.gz

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 21:01:31 2024 UTC