[php-maint] Bug#336275: marked as done (Function mysql_fetch_field crashes Apache [package php4-mysql (stable) 4:4.3.10-16_i386])

Debian Bug Tracking System owner at bugs.debian.org
Sat Oct 29 12:03:09 UTC 2005


Your message dated Sat, 29 Oct 2005 21:54:41 +1000
with message-id <43636301.7010308 at 0c3.net>
and subject line Function mysql_fetch_field crashes Apache [package php4-mysql (stable) 4:4.3.10-16_i386]
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 29 Oct 2005 05:14:56 +0000
>From adrian.caneva at gmail.com Fri Oct 28 22:14:56 2005
Return-path: <adrian.caneva at gmail.com>
Received: from zproxy.gmail.com [64.233.162.207] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EVj3Q-0006RY-00; Fri, 28 Oct 2005 22:14:56 -0700
Received: by zproxy.gmail.com with SMTP id o37so529308nzf
        for <submit at bugs.debian.org>; Fri, 28 Oct 2005 22:14:54 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition;
        b=GnsO5XjHWQ/5nNBCXHuiqwYgaEyG8sbdB6FmJF8LpLJuWdjQd50UFXBmQAEMcuUFlki3KyTtd1bMd6oJ2qX6+D12ePAdIhGKAua0lW9Z+xNnxXIPSanRB3QsXfyh4c/bReaKtNF3sqmrJo339E1ifPFFyap/Tiheyv08S/bWqMs=
Received: by 10.37.2.33 with SMTP id e33mr1006582nzi;
        Fri, 28 Oct 2005 22:14:54 -0700 (PDT)
Received: by 10.36.60.6 with HTTP; Fri, 28 Oct 2005 22:14:54 -0700 (PDT)
Message-ID: <479535b80510282214s6c7217bdm at mail.gmail.com>
Date: Sat, 29 Oct 2005 02:14:54 -0300
From: Adrian Caneva <adrian.caneva at gmail.com>
To: submit at bugs.debian.org
Subject: Function mysql_fetch_field crashes Apache [package php4-mysql (stable) 4:4.3.10-16_i386]
Cc: adconrad at 0c3.net
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Delivered-To: submit at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.5 required=4.0 tests=BAYES_00,HAS_PACKAGE,
	HTML_MESSAGE autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: php4-mysql
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 112
Maintainer: Adam Conrad <adconrad at 0c3.net>
Source: php4
Version: 4:4.3.10-16
Replaces: php4-cgi-mysql
Depends: libc6 (>=3D 2.3.2.ds1-21), libmysqlclient12, debconf (>=3D 0.5) |
debconf-2.0, phpapi-20020918, php4-common (=3D 4:4.3.10-16)
Description: MySQL module for php4
 This package provides a module for MySQL database connections directly fro=
m
 PHP scripts.
 .
 PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowe=
d
 from C, Java and Perl with a couple of unique PHP-specific features thrown
 in. The goal of the language is to allow web developers to write
 dynamically generated pages quickly.

SYMPTOMS
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Applications
-----------------

Under apache-ssl (1.3.33-6sarge1, more info on package versions below):

a) PhpMyAdmin Version: 4:2.6.2-3  won=B4t browse tables (Browse Tab
after tables are selected)
b) Wordpress Version: 1.5.2 would show blank pages (<html><body></body></ht=
ml>)


Logs
-------
- Apache won=B4t log HTTP requests/access from php scripts including
mysql_fetch_field calls
- But MySQL logs their sql queries
- No /var/log/messages, syslog, etc errors are shown
- No PHP errors logged

PROBLEM
=3D=3D=3D=3D=3D=3D=3D=3D-
Apache crashes when @mysql_fetch_fields() function is called into a php scr=
ipt.

TEST CODE test.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<?php
$conn =3D mysql_connect('localhost:3306', 'user', 'pass');
mysql_select_db('db);
$result =3D mysql_query('select * from table');
/* get column metadata */
$i =3D 0;
while ($i < mysql_num_fields($result)) {
   echo "Information for column $i:<br />\n";
      $meta =3D mysql_fetch_field($result, $i);
         $i++;
         }
 mysql_free_result($result);
?>

WORKAROUND
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I've extracted mysql.so from package :

php4-mysql_4%3a4.3.9-1_i386.deb

And replaced

/usr/lib/php4/20020429/mysql.so

Restarting apache, the problem was solved.

ALSO tried
=3D=3D=3D=3D=3D=3D=3D=3D
Downloading sources php4-mysql (latest source 4.3.10-15) and compiling
(buildpackage). mysql.so obtained had the same trouble as the binary
included with php4-mysql (4.3.10-16)

KERNEL
=3D=3D=3D=3D=3D=3D=3D
Linux 2.6.8-1-686

RELATED Packages Installed
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
php4           4.3.10-16      server-side, HTML-embedded scripting languag
php4-cgi       4.3.4-4        A server-side, HTML-embedded scripting langu
php4-cli       4.3.10-16      command-line interpreter for the php4 script
php4-common    4.3.10-16      Common files for packages built from the php
php4-gd        4.3.10-16      GD module for php4
php4-mhash     4.3.10-16      MHASH module for php4
php4-mysql     4.3.10-16      MySQL module for php4
php4-pear      4.3.10-16      PEAR - PHP Extension and Application Reposit

apache-common  1.3.33-6sarge1 support files for all Apache webservers
apache-dev     1.3.33-6sarge1 development kit for the Apache webserver
apache-ssl     1.3.33-6sarge1 versatile, high-performance HTTP server with
apache-utils   1.3.31-7       Utility programs for webservers
apache2-common 2.0.54-5       next generation, scalable, extendable web se
apache2-prefor 2.0.54-5       development headers for apache2
apache2-utils  2.0.54-5       utility programs for webservers
libapache-mod- 4.3.8-1        Apache module for MySQL authentication
libapache-mod- 1.0.3-10       A DAV module for Apache
libapache-mod- 0.0.20021209-6 Apache module for non-ascii filename interop
libapache-mod- 4.3.10-16      server-side, HTML-embedded scripting languag
libiconv-hook1 0.0.20021209-6 extension of iconv for libapache-mod-encodin

libc6          2.3.2.ds1-22   GNU C Library: Shared libraries and Timezone
libc6-dev      2.3.2.ds1-22   GNU C Library: Development Libraries and Hea

libmysqlclient 4.0.24-10sarge mysql database client library
libmysqlclient 4.1.11a-4sarge mysql database client library
mysql-client-4 4.1.11a-4sarge mysql database client binaries
mysql-common-4 4.1.11a-4sarge mysql database common files (e.g. /etc/mysql
mysql-server-4 4.1.11a-4sarge mysql database server binaries

phpmyadmin         2.6.2-3            set of PHP-scripts to
administrate MySQL over the WW


Thanks, hope that this info can help.
adrian

---------------------------------------
Received: (at 336275-done) by bugs.debian.org; 29 Oct 2005 11:55:20 +0000
>From adconrad at 0c3.net Sat Oct 29 04:55:20 2005
Return-path: <adconrad at 0c3.net>
Received: from loki.0c3.net [69.0.240.48] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EVpIu-000518-00; Sat, 29 Oct 2005 04:55:20 -0700
Received: from [203.49.196.168] (helo=[10.0.0.4])
	by loki.0c3.net with esmtp (Exim 4.34)
	id 1EVpIP-0001aK-82; Sat, 29 Oct 2005 05:54:49 -0600
Message-ID: <43636301.7010308 at 0c3.net>
Date: Sat, 29 Oct 2005 21:54:41 +1000
From: Adam Conrad <adconrad at 0c3.net>
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Adrian Caneva <adrian.caneva at gmail.com>,  336275-done at bugs.debian.org
Subject: Re: Function mysql_fetch_field crashes Apache [package php4-mysql
 (stable) 4:4.3.10-16_i386]
References: <479535b80510282214s6c7217bdm at mail.gmail.com>
In-Reply-To: <479535b80510282214s6c7217bdm at mail.gmail.com>
X-Enigmail-Version: 0.92.1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Delivered-To: 336275-done at bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02

Adrian Caneva wrote:
>
> Version: 4:4.3.10-16
> Depends: libc6 (>= 2.3.2.ds1-21), libmysqlclient12, debconf (>= 0.5)
> [...]
> libapache-mod- 4.3.8-1        Apache module for MySQL authentication

Please make sure your Sarge system is completely up to date.  Currently,
you're loading two versions of libmysqlclient (10 and 12) into apache's
memory space, due to having the most recent php4-mysql (which depends on
libmysqlclient12), but an older libapache-mod-auth-mysql (which depends
on libmysqlclient10).

If you upgrade to the sarge release version of libapache-mod-auth-mysql
(4.3.9-2), your problems will likely magically clear up.

... Adam



More information about the pkg-php-maint mailing list