From owner-freebsd-amd64@FreeBSD.ORG Sun May 1 19:42:35 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A418516A4CE for ; Sun, 1 May 2005 19:42:35 +0000 (GMT) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E73343D39 for ; Sun, 1 May 2005 19:42:35 +0000 (GMT) (envelope-from oliver.schonrock@realtsp.com) Received: from [84.92.66.197] (helo=[192.168.0.12]) by ptb-relay01.plus.net with esmtp (Exim) id 1DSKKo-0003JE-4n for freebsd-amd64@freebsd.org; Sun, 01 May 2005 20:42:34 +0100 Message-ID: <4275312F.8010800@realtsp.com> Date: Sun, 01 May 2005 20:42:39 +0100 From: Oliver Schonrock User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-amd64@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Fwd: Re: FreeBSD Port: php5-mysqli-5.0.4_1] X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2005 19:42:35 -0000 furher information in reply to Uzi from ports maintainers. -------- Original Message -------- Subject: Re: FreeBSD Port: php5-mysqli-5.0.4_1 Date: Sun, 01 May 2005 16:14:59 +0100 From: Oliver Schonrock To: Uzi Klein CC: ports@freebsd.org References: <4274B75C.2010203@realtsp.com> <4274C11E.4020308@bmby.com> please see below: I apologise for the long email in advance. I have tried to provide information that is as complete as possible. Thanks very much for your help. Oliver Schonrock Uzi Klein wrote: > Oliver Schonrock wrote: > ... > >> Hi >> >> We run 4 FreeBSD servers now and have just built first FBSD server on >> AMD64. Everything went quite smoothly using the amd64 version of freebsd. >> >> until... >> >> I tried to use the mysqli extension in php5.0.4 on apache 1.3.33 >> connecting to mysql-server-4.1.11 (all built from cvsup'd ports tree). >> >> in php mysql_connect() works ok, but the mysql_fetch_array() segfaults. >> >> this simple php script produces the error every time (via apache or >> with command line binary): >> >> > >> $db = new mysqli('localhost', 'root', 'mysqlrootpw', 'mysql'); >> >> $result = $db->query('select * from user;'); >> >> while ($row = $result->fetch_array(MYSQLI_ASSOC)) >> { >> print_r($row); >> } >> >> ?> >> >> => Segmentation fault (core dumped) >> > > I have seen mysql 4.1x dies with queries that runs fine under 4.0x. > Could it be that? not really, since: a) out application/queries are running fine under 4.1.11 on i386 (Athlon and Pentium) hardware b) the trivial select query in the script above should be fine on either server. c) the query above runs fine when I use the mysql extension as in this script: oliver@pakiri$ cat phpmysqltest.php ... gives sensible output without errors. So that would indicate to me that the query is fine for the server, but may be causing the client library to crash when the data is retrieved with mysql_fetch_...(). Both php extensions (mysql and mysqli) are linked against the mysql41-client libraries as this shows: root@pakiri# cd /usr/ports/databases/mysql root@pakiri# make deinstall ===> Deinstalling for databases/mysql41-client ===> Deinstalling mysql-client-4.1.11_1 pkg_delete: package 'mysql-client-4.1.11_1' is required by these other packages and may not be deinstalled (but I'll delete it anyway): mysql-server-4.1.11_1 php5-mysql-5.0.4_1 php5-mysqli-5.0.4_1 pkg_delete: unable to completely remove directory '/usr/local/lib/mysql' pkg_delete: unable to completely remove directory '/usr/local/share/mysql' pkg_delete: couldn't entirely delete package (perhaps the packing list is incorrectly specified?) Anyway it is a requirement that both extensions (mysql and mysqli) use the same client libraries as stated here: http://uk.php.net/manual/en/ref.mysql.php and they won't build unless you are using the same client library for both as the makefile checks for this. So my current guess to the source of the problem is somewhere around where the php5-mysqli extension maps the mysql41-client api into php. Does that make sense to you given this info? > What application gives you the sig 11? is it apache or mysql? > > Please attach relevant log files etc. When I run the above script from the command line with: oliver@pakiri$ php phpmysqlitest.php I get the following in /var/log/messages: root@pakiri# tail -f messages May 1 16:27:45 pakiri kernel: pid 91764 (php), uid 1003: exited on signal 11 (core dumped) when I hit that script over the web via apache I get: May 1 16:27:54 pakiri kernel: pid 29441 (httpd), uid 80: exited on signal 11 So I looks like in either case that it is the php binary (or more precisely the php5-mysqli extension) that is causing the "signal 11". I hope this helps in diagnosis. Thanks again.