Bug 145788

Summary: databases/php5-pdo_mysql: pdo_mysql dumps core if allowed in extensions.ini
Product: Ports & Packages Reporter: Adam PAPAI <wooh>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Adam PAPAI 2010-04-17 22:40:01 UTC
Yesterday I updated PHP and extensions via portsnap & portmaster.

My PHP version is:

PHP 5.3.2 with Suhosin-Patch (cli) (built: Apr 17 2010 01:13:25) 

If I add the pdo_mysql extension to the extensions.ini the php dumps core.

My installed php packages are:

php5-5.3.2          PHP Scripting Language
php5-calendar-5.3.2 The calendar shared extension for php
php5-ctype-5.3.2    The ctype shared extension for php
php5-curl-5.3.2     The curl shared extension for php
php5-dom-5.3.2      The dom shared extension for php
php5-extensions-1.4 A "meta-port" to install PHP extensions
php5-filter-5.3.2   The filter shared extension for php
php5-ftp-5.3.2      The ftp shared extension for php
php5-gd-5.3.2       The gd shared extension for php
php5-gettext-5.3.2  The gettext shared extension for php
php5-hash-5.3.2     The hash shared extension for php
php5-iconv-5.3.2    The iconv shared extension for php
php5-imap-5.3.2     The imap shared extension for php
php5-json-5.3.2     The json shared extension for php
php5-mbstring-5.3.2 The mbstring shared extension for php
php5-mcrypt-5.3.2   The mcrypt shared extension for php
php5-mysql-5.3.2    The mysql shared extension for php
php5-mysqli-5.3.2   The mysqli shared extension for php
php5-openssl-5.3.2  The openssl shared extension for php
php5-pdo-5.3.2      The pdo shared extension for php
php5-pdo_mysql-5.3.2 The pdo_mysql shared extension for php
php5-pgsql-5.3.2    The pgsql shared extension for php
php5-posix-5.3.2    The posix shared extension for php
php5-session-5.3.2  The session shared extension for php
php5-simplexml-5.3.2 The simplexml shared extension for php
php5-soap-5.3.2     The soap shared extension for php
php5-sockets-5.3.2  The sockets shared extension for php
php5-sqlite-5.3.2   The sqlite shared extension for php
php5-tokenizer-5.3.2 The tokenizer shared extension for php
php5-xml-5.3.2      The xml shared extension for php
php5-xmlreader-5.3.2 The xmlreader shared extension for php
php5-xmlwriter-5.3.2 The xmlwriter shared extension for php
php5-zlib-5.3.2     The zlib shared extension for php

The gdb output:

where
#0  0x000000000055bc9a in zend_startup_module_ex ()
#1  0x0000000000562768 in zend_hash_apply ()
#2  0x000000000055ba80 in zend_startup_modules ()
#3  0x00000000004f40a8 in php_module_startup ()
#4  0x00000000005ed78d in php_cli_startup ()
#5  0x00000000005edf95 in main ()
#6  0x0000000000417c95 in _start ()

How-To-Repeat: Install php5-5.3.2 and pdo/mysql_pdo from ports.
Comment 1 gnats freebsd_committer freebsd_triage 2010-04-18 08:56:47 UTC
Responsible Changed
From-To: freebsd-amd64->ale

Make this a ports PR, fix synopsis, and assign.
Comment 2 Adam PAPAI 2010-04-20 09:49:34 UTC
It dumps on a 8.0-RELEASE-p2 as well if I enable pdo_mysql.

I cannot install mod_php5 via packages so I really need this fix ASAP.


-- 
Adam PAPAI
Comment 3 Adam PAPAI 2010-04-20 10:56:27 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've compiled the PHP --with-debug

The trace shows:

(gdb) where
#0  0x0821ceaa in zend_startup_module_ex (module=0x2880bbe0,
tsrm_ls=0x28802040) at
/usr/ports/lang/php5/work/php-5.3.2/Zend/zend_API.c:1618
#1  0x082264f9 in zend_hash_apply (ht=0x83b57e0, apply_func=0x821cc70
<zend_startup_module_ex>, tsrm_ls=0x28802040) at
/usr/ports/lang/php5/work/php-5.3.2/Zend/zend_hash.c:673
#2  0x0821cffd in zend_startup_modules (tsrm_ls=0x28802040) at
/usr/ports/lang/php5/work/php-5.3.2/Zend/zend_API.c:1662
#3  0x0818cdf3 in php_module_startup (sf=0x83a1d40,
additional_modules=0x0, num_additional_modules=0) at
/usr/ports/lang/php5/work/php-5.3.2/main/main.c:2022
#4  0x082fb8e1 in php_cli_startup (sapi_module=0x83a1d40) at
/usr/ports/lang/php5/work/php-5.3.2/sapi/cli/php_cli.c:401
#5  0x082fc6c0 in main (argc=1, argv=0xbfbfecb8) at
/usr/ports/lang/php5/work/php-5.3.2/sapi/cli/php_cli.c:775


- -- 
Adam PAPAI
NETIDEA Informatikai Szolgáltató Kft.
http://www.netidea.hu
E-mail: wooh@wooh.hu
Phone: +36 30 33-55-735 (Hungary)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJLzXpLAAoJEGq0EWvh5uiI01gIAIlux45emN1n+GBTL+Tn2JyO
GxSTsxUEFWVYvruA7T0h7qU9H5iKMSxfRKDqzQnLFNUbXZ96XA4okTZLjYpBNR7n
zQ7tqkAGfR9mX/22WXwU2o3zPva9cUY+YJUNSXjLiZKUAG5ADECwHex3pnvlMbnN
hRP8wH0/joQf37sKLAHOeiFDGpX7v+4W74ztFvx9MznuF3kABtyMM9PI482EYdpZ
c4iLc6PJhrovFLXKKGWy8HwKfRZAZzJQnuGaU/WNabJ8u4B77GTKQMCJkxqpifA7
RqbeFURuDKk87+Bo8gNSxvGgaiEmvviwkPzAR+Mnz4eT/g8sg4RRU3EsnKTSXVs=
=BY0v
-----END PGP SIGNATURE-----
Comment 4 Michael Scheidell 2010-05-31 19:07:34 UTC
I thought I would chime in and ask that this be looked at.
If you disable one of our os choices (version 6.4) and ask us to 
upgrade, the upgraded OS and ports need to work :-)  If they don't, then 
please don't yell at us when we ask for legacy support for ports for 
'unsupported' versions of the os (yes, I would rather you work on the 
current problem)

Same problem here, freebsd 7.3, php52*
EVERYTHING RECOMPILED, make world, portupgrade -faR.  everything.

I put php52-mysql or php52-pdo_mysql in extensions and php52 coredumps.

I have tried different compiler options and kernel options.



-- 
Michael Scheidell, CTO
Phone: 561-999-5000, x 1259
 > *| *SECNAP Network Security Corporation

    * Certified SNORT Integrator
    * 2008-9 Hot Company Award Winner, World Executive Alliance
    * Five-Star Partner Program 2009, VARBusiness
    * Best Anti-Spam Product 2008, Network Products Guide
    * King of Spam Filters, SC Magazine 2008


______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.secnap.com/products/spammertrap/
______________________________________________________________________  
Comment 5 Adam PAPAI 2010-05-31 19:13:16 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/31/10 8:07 PM, Michael Scheidell wrote:
> I thought I would chime in and ask that this be looked at.
> If you disable one of our os choices (version 6.4) and ask us to
> upgrade, the upgraded OS and ports need to work :-)  If they don't, then
> please don't yell at us when we ask for legacy support for ports for
> 'unsupported' versions of the os (yes, I would rather you work on the
> current problem)
> 
> Same problem here, freebsd 7.3, php52*
> EVERYTHING RECOMPILED, make world, portupgrade -faR.  everything.
> 
> I put php52-mysql or php52-pdo_mysql in extensions and php52 coredumps.
> 
> I have tried different compiler options and kernel options. 

On my server I purged everything related to PHP. (deleted the remainng
files by hand, especially extensions) and installed them from scratch
(php52*).

Now everything works like charm on my server.

You should have old dependency files (shared libs perhaps).

So my proposal is: delete everything and compile PHP and PHP related
extensions again. (like a clear install). Recompile seems not solving it.

I hope it helps.
Please let me know if succeeds/fails.

Best Regards,

- -- 
Adam PAPAI
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMA/w7AAoJEGq0EWvh5uiIbrgH/jZrzCRXtwYzRB8xMuSVaL5A
oNGh+RWb9nZqNB/t1LOnC3CNyQJO1uDPmBfHfeAs1KUhctBRbHBIjIZ4i/v4AfkI
gDjm+ERCEmsWjUvsAXZ3EZyJ/pzcHYzxHfvJe9pHg4DZQ53M7Jdb2reJ3iPZjStG
LRoWJj3sbDZwzP8GHVOpNwFKvvxHjSWeY2OJ5fHEshYvw6wc3NLV/S6a02WsG9g6
r1Lj3Gd74KwyYWp33pJJgd8OCvNFHcfQ0iP3bgN4LXJt3eNWIuxLfVaa1x6O9Gj7
kjND1V1etAUE0X40VhfTp+GCNjb7Vwkt82+N9B6XqlUgQIOOvah71MdDq9OzZFo=
=JeEf
-----END PGP SIGNATURE-----
Comment 6 Michael Scheidell 2010-05-31 19:18:35 UTC
On 5/31/10 2:13 PM, Adam PAPAI wrote:
> On 5/31/10 8:07 PM, Michael Scheidell wrote:
>    
> On my server I purged everything related to PHP. (deleted the remainng
> files by hand, especially extensions) and installed them from scratch
> (php52*).
>
>    
thought I did that a couple of times . /usr/local/lib/compat/pkg/*
but I'll try again.  (and I am using i386 and freebsd 7.3,  and php52, 
not php5.3 so, SOMETHING is wrong)

> You should have old dependency files (shared libs perhaps).
>
>    
maybe, but find -mtime on /usr/ and /lib did't find anything that I 
didn't think should be there.

I'll give it a shot.  thanks for the reply.

-- 
Michael Scheidell, CTO
Phone: 561-999-5000, x 1259
 > *| *SECNAP Network Security Corporation

    * Certified SNORT Integrator
    * 2008-9 Hot Company Award Winner, World Executive Alliance
    * Five-Star Partner Program 2009, VARBusiness
    * Best Anti-Spam Product 2008, Network Products Guide
    * King of Spam Filters, SC Magazine 2008

______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.secnap.com/products/spammertrap/
______________________________________________________________________
Comment 7 Michael Scheidell 2010-05-31 20:05:45 UTC
my problem solved.  don't include openssl in client when you compile.

On 5/31/10 2:13 PM, Adam PAPAI wrote:
>
>> Same problem here, freebsd 7.3, php52*
>> EVERYTHING RECOMPILED, make world, portupgrade -faR.  everything.
>>
>>      
I tried this:
pkg_delete -f php\* databases/mysql51-client\*

find /usr/local -name '*php' -delete
I looked in ../compat/pkg  lib, libexex, include, everywhere to get rid 
of anything I thought had to do with php.
I did: portinstall databases/mysql51-client
I did portinstall lang/php52
I did portinstall databases/php52-mysql

php -v still segv's.


problem for me with the  WITH_OPENSSL option in mysql client.
compile mysql51-client with these options and it fails:
BUILD_OPTIMIZED=1 WITH_PROC_SCOPE_PTH=1 WITH_FAST_MUTEXES=1 WITH_OPENSSL=1'

compile with these, and its fine (no need to recompile php52 on my side)

BUILD_OPTIMIZED=1 WITH_PROC_SCOPE_PTH=1 WITH_FAST_MUTEXES=1

this with or without php52-openssl support in extensions.

do, on MY side, at least, freebsd, relend 7.3, i386, php52, mysql 
5.1.47, if I compile openssl into the mysql client, php fails.

I might try yaSSL later when I have recovered from 4 days of constant 
recompiling.

<http://dev.mysql.com/doc/refman/5.1/en/secure-using-ssl.html>


-- 
Michael Scheidell, CTO
Phone: 561-999-5000, x 1259
 > *| *SECNAP Network Security Corporation

    * Certified SNORT Integrator
    * 2008-9 Hot Company Award Winner, World Executive Alliance
    * Five-Star Partner Program 2009, VARBusiness
    * Best Anti-Spam Product 2008, Network Products Guide
    * King of Spam Filters, SC Magazine 2008


______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.secnap.com/products/spammertrap/
______________________________________________________________________  
Comment 8 Alex Dupre freebsd_committer freebsd_triage 2010-06-01 09:17:25 UTC
State Changed
From-To: open->feedback

Currently you cannot use mysql-client compiled with yaSSL together with 
a non-threaded PHP. Can you disable ssl in mysql or use openssl instead of yaSSL?
Comment 9 Michael Scheidell 2010-06-01 18:34:16 UTC
looks like a known (but not fully documented in PR) problem:

<http://forums.freebsd.org/showthread.php?t=7257>

-- 
Michael Scheidell, CTO
Phone: 561-999-5000, x 1259
 > *| *SECNAP Network Security Corporation

    * Certified SNORT Integrator
    * 2008-9 Hot Company Award Winner, World Executive Alliance
    * Five-Star Partner Program 2009, VARBusiness
    * Best Anti-Spam Product 2008, Network Products Guide
    * King of Spam Filters, SC Magazine 2008


______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.secnap.com/products/spammertrap/
______________________________________________________________________  
Comment 10 Alex Dupre freebsd_committer freebsd_triage 2010-08-31 15:32:44 UTC
State Changed
From-To: feedback->closed

Now you can build PHP with threads or use MYSQLND.