|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-05 07:52 UTC] michi102 at gmx dot de
Server conf: apache 1.3.27, php 4.3.1, MySQL 4.0.12, phpMyAdmin 2.4.0
Whenever I try to use mysql_fetch_field, I'll get a segmentation fault. I recognized this first when using phpMyAdmin to query the database via "Browse". Then I tried using mysql_fetch_field in own scripts - same result.
Example:
$result = mysql_query("select * from admin";$db);
while ($field = mysql_fetch_field($result)) {
$fields_meta[] = $field;
}
It doesn't matter what I do inside the while loop - the result is always the same: segfault.
My php config string:
'./configure' '--with-apxs=/usr/local/httpd/bin/apxs' '--bindir=/usr/bin' '--libdir=/usr/lib' '--with-config-file-path=/etc' '--with-exec-dir=%{libdir}/php/bin' '--with-open-ssl' '--enable-sockets' '--with-mysql=/usr' '--enable-bcmath' '--enable-calendar' '--with-ftp' '--enable-wddx' '--with-zlib' '--with-zlib-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-imap=/usr' '--with-imap-ssl=/usr' '--with-xpm-dir=/usr/X11R6' '--with-tiff-dir=/usr' '--enable-exif' '--enable-ctype' '--enable-dba' '--with-mcrypt' '--disable-rpath' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-sysvmsg' '--enable-track-vars' '--enable-magic-quotes' '--enable-versioning' '--enable-sigchild' '--disable-debug' '--enable-trans-sid' '--enable-pcntl' '--enable-memory-limit' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-sigchild'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
So the backtrace : #0 0x40428c0f in strlen () from /lib/libc.so.6 #1 0x08218fb1 in add_property_string_ex (arg=0x844e744, key=0x82d5e53 "def", key_len=4, str=0xa <Address 0xa out of bounds>, duplicate=1) at /usr/local/src/php-4.3.6/Zend/zend_API.c:978 #2 0x081040ed in zif_mysql_fetch_field (ht=2, return_value=0x844e744, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-4.3.6/ext/mysql/php_mysql.c:2163 #3 0x0822980f in execute (op_array=0x8449694) at /usr/local/src/php-4.3.6/Zend/zend_execute.c:1635 #4 0x0821600c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-4.3.6/Zend/zend.c:886 #5 0x081daf0c in php_execute_script (primary_file=0xbffffa60) at /usr/local/src/php-4.3.6/main/main.c:1731 #6 0x0823066d in main (argc=2, argv=0xbffffb04) at /usr/local/src/php-4.3.6/sapi/cli/php_cli.c:822 I don't I it can help you, but this is the "frames" : (gdb) frame 0 #0 0x40428c0f in strlen () from /lib/libc.so.6 (gdb) frame 1 #1 0x08218fb1 in add_property_string_ex (arg=0x844e744, key=0x82d5e53 "def", key_len=4, str=0xa <Address 0xa out of bounds>, duplicate=1) at /usr/local/src/php-4.3.6/Zend/zend_API.c:978 978 ZVAL_STRING(tmp, str, duplicate); (gdb) frame 2 #2 0x081040ed in zif_mysql_fetch_field (ht=2, return_value=0x844e744, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-4.3.6/ext/mysql/php_mysql.c:2163 2163 add_property_string(return_value, "def",(mysql_field->def?mysql_field->def:empty_string), 1); (gdb) frame 3 #3 0x0822980f in execute (op_array=0x8449694) at /usr/local/src/php-4.3.6/Zend/zend_execute.c:1635 1635 ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); I tried to reinstall the binary version of MySQL 4.0.20, and I have always the same bug. I tried PHP 4.3.7RC1 too, and it's the same.