php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40256 PHP & Apache segfaults when using curl
Submitted: 2007-01-27 15:17 UTC Modified: 2007-01-27 15:49 UTC
From: pentarh at gmail dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 4.4.4 OS: FreeBSD 6.2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pentarh at gmail dot com
New email:
PHP Version: OS:

 

 [2007-01-27 15:17 UTC] pentarh at gmail dot com
Description:
------------
OS: FreeBSD 6.2 am64
trying to compile latest PHP 4.4.4 (also tried fresh snapshot php4-STABLE-200701271330) with curl 7.16.0

./configure \
--with-gd=/usr/local \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-freetype-dir=/usr/local \
--enable-gd-native-ttf \
--with-jpeg=/usr/local \
--with-jpeg-dir=/usr/local/include \
--with-png-dir=/usr/local/include \
--with-zlib-dir=/usr/local/lib \
--enable-ftp \
--enable-sockets \
--with-curl=/usr/local

after make install got the error:

# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp4.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp4.la /usr/local/apache2/modules/
cp .libs/libphp4.so /usr/local/apache2/modules/libphp4.so
cp .libs/libphp4.lai /usr/local/apache2/modules/libphp4.la
libtool: install: warning: remember to run `libtool --finish /usr/work/php4-STABLE-200701271330/libs'
chmod 755 /usr/local/apache2/modules/libphp4.so
[activating module `php4' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing PEAR environment:      /usr/local/lib/php/
Segmentation fault (core dumped)
*** Error code 139

Apache does segfault on start with libphp4.so activated.
These all problems appear when using --with-curl

backtrace of php CLI segfault
#0  0x00000008012e0ab8 in ENGINE_add () from /lib/libcrypto.so.4
#1  0x00000008012834b6 in ENGINE_load_cswift () from /lib/libcrypto.so.4
#2  0x000000080127683e in ENGINE_load_builtin_engines () from /lib/libcrypto.so.4
#3  0x0000000800fac309 in Curl_ossl_init () at ssluse.c:559
#4  0x0000000800fb496d in curl_global_init (flags=1) at easy.c:229
#5  0x0000000000469973 in zm_startup_curl (type=9360897, module_number=35, tsrm_ls=0x23)
    at /usr/work/php4-STABLE-200701271330/ext/curl/curl.c:487
#6  0x000000000054909c in zend_startup_module (module=0x717720)
    at /usr/work/php4-STABLE-200701271330/Zend/zend_API.c:1006
#7  0x0000000000510325 in php_startup_extensions (ptr=0x72a530, count=19892511)
    at /usr/work/php4-STABLE-200701271330/main/main.c:1056
#8  0x0000000000510970 in php_module_startup (sf=0x723e00, additional_modules=0x0,
    num_additional_modules=0) at /usr/work/php4-STABLE-200701271330/main/main.c:1230
#9  0x0000000000564aae in main (argc=16, argv=0x7fffffffe8c8)
    at /usr/work/php4-STABLE-200701271330/sapi/cli/php_cli.c:588


Reproduce code:
---------------
./configure \
--with-gd=/usr/local \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-freetype-dir=/usr/local \
--enable-gd-native-ttf \
--with-jpeg=/usr/local \
--with-jpeg-dir=/usr/local/include \
--with-png-dir=/usr/local/include \
--with-zlib-dir=/usr/local/lib \
--enable-ftp \
--enable-sockets \
--with-curl=/usr/local

make
make install

Expected result:
----------------
no segfault

Actual result:
--------------
segfault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-27 15:29 UTC] tony2001@php.net
Remove --with-mysql from the configure line to make sure your problems are not caused by conflict between YaSSL used in MySQL and OpenSSL.
 [2007-01-27 15:43 UTC] pentarh at gmail dot com
you right. it compiles well with either curl or mysql.
i removed --with-mysql and "make install" worked without segfault.

But i need both curl and mysql. what should i do?
 [2007-01-27 15:49 UTC] tony2001@php.net
Upgrade mysql client to the latest available version, AFAIK it's fixed there.
Not PHP problem anyway.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 16:01:28 2024 UTC