Bug #3331: PHP crashes when using mysql_connect
| From: | axelm+php at nona dot net | Date: | Thu, 27 Jan 2000 18:10:34 +0000 |
| Subject: | Bug #3331: PHP crashes when using mysql_connect | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14960@lists.php.net to get a copy of this message | ||
From: axelm+php@nona.net
Operating system: Solaris 2.6
PHP version: 3.0.14
PHP Bug Type: Reproduceable crash
Bug description: PHP crashes when using mysql_connect
PHP has been compiled as CGI using the follwing configure options:
./configure --enable-force-cgi-redirect --with-gd --with-ttf --with-mysql --disable-display-source
--with-config-file-path=/etc --with-ldap
when running it against a script containing only this line:
<? include "categories.inc"; ?>
and "categories.inc" starting with:
<TD>
<? $dbhost="XXXXXX";
$dbname="XXXX";
$dbuser="XXXXX";
$dbpwd="XXXXX";
print "$REMOTE_USER";
$mysql=mysql_connect($dbhost, $dbuser, $dbpwd);
mysql_select_db($dbname, $mysql);
...
php segfaults:
gdb reports:
(gdb) bt
#0 0xef506784 in _free_unlocked ()
#1 0xef50673c in free ()
#2 0xef719968 in my_no_flags_free ()
#3 0xef7170b4 in mysql_close ()
#4 0xef716e4c in mysql_real_connect ()
#5 0xef716388 in mysql_connect ()
#6 0x6fc30 in php3_mysql_do_connect (ht=0x15f0f8, return_value=0x100938,
list=0x111870, plist=0x111fbc, persistent=0) at functions/mysql.c:576
#7 0x6fe20 in php3_mysql_connect (ht=0x15f0f8, return_value=0x100938,
list=0x111870, plist=0x111fbc) at functions/mysql.c:621
#8 0x28fec in cs_functioncall_post_variable_passing (
function_name=0xefffebf8, phpchar=0xefffeba4)
at control_structures_inline.h:929
#9 0x2cb00 in phpparse () at language-parser.y:528
#10 0x35ae8 in php3_parse (yyin=0x111e78) at main.c:1538
#11 0x36854 in main (argc=2, argv=0xeffffb8c) at main.c:1829
my php3.ini contains:
short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = Off
safe_mode = On
safe_mode_exec_dir = /bin
highlight.string = #DD0000
highlight.comment = #FF8000
highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight.html = #000000
max_execution_time = 30
memory_limit = 25000000
error_reporting = 7
display_errors = On
log_errors = On
track_errors = Off
warn_plus_overloading = Off
magic_quotes_gpc = On
magic_quotes_runtime = Off
track_vars = On
upload_tmp_dir = /tmp
upload_max_filesize = 2097152
when running php againts the categories.inc file alone, gdb reports:
Program received signal SIGSEGV, Segmentation fault.
0xef506784 in _free_unlocked ()
(gdb) bt
#0 0xef506784 in _free_unlocked ()
#1 0xef50673c in free ()
#2 0xef719968 in my_no_flags_free ()
#3 0xef7170b4 in mysql_close ()
#4 0xef716e4c in mysql_real_connect ()
#5 0xef716388 in mysql_connect ()
#6 0x6fc30 in php3_mysql_do_connect (ht=0x15f0f8, return_value=0x100938,
list=0x111870, plist=0x111fbc, persistent=0) at functions/mysql.c:576
#7 0x6fe20 in php3_mysql_connect (ht=0x15f0f8, return_value=0x100938,
list=0x111870, plist=0x111fbc) at functions/mysql.c:621
#8 0x28fec in cs_functioncall_post_variable_passing (
function_name=0xefffebf8, phpchar=0xefffeba4)
at control_structures_inline.h:929
#9 0x2cb00 in phpparse () at language-parser.y:528
#10 0x35ae8 in php3_parse (yyin=0x111e78) at main.c:1538
#11 0x36854 in main (argc=2, argv=0xeffffb8c) at main.c:1829