php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26264 php segfaults with iconv or mbstring enabled
Submitted: 2003-11-15 13:56 UTC Modified: 2003-12-19 07:55 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: Joerg dot Dieter dot Friedrich at uni-konstanz dot de Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.4 OS: Solaris 9
Private report: No CVE-ID: None
 [2003-11-15 13:56 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
Description:
------------
Hi!

I tried to use php 4.3.4 with iconv support but it always segfaults when iconv is enabled.

Btw. I wanted to use sun's iconv but gnu iconv had the same  result.

I tried to compiled php with --enable-debug which stoped this way:
gcc -I/usr/include -Iext/iconv/ -I/usr/local/src/php-4.3.4/ext/iconv/ -DPHP_ATOM_INC -I/usr/local/src/php-4.3.4/include -I/usr/local/src/php-4.3.4/main -I/usr/local/src/php-4.3.4 -I/usr/local/src/php-4.3.4/Zend -I/usr/local/ssl/include -I/usr/local/include/libxml2 -I/usr/sfw/include -I/usr/local/src/imap-2002e/c-client -I/usr/local/include -I/opt/mysql/include/mysql -I/usr/local/src/php-4.3.4/ext/xml/expat -D_POSIX_PTHREAD_SEMANTICS -I/usr/local/src/php-4.3.4/TSRM -g -Wall -pedantic -c /usr/local/src/php-4.3.4/ext/iconv/iconv.c    -fPIC -DPIC -o ext/iconv/iconv.lo
In file included from /usr/local/src/php-4.3.4/ext/iconv/iconv.c:40:
/usr/include/iconv.h:8: warning: ignoring #pragma ident
/usr/local/src/php-4.3.4/ext/iconv/iconv.c: In function `zm_startup_miconv':
/usr/local/src/php-4.3.4/ext/iconv/iconv.c:129: error: `_libiconv_version' undeclared (first use in this function)
/usr/local/src/php-4.3.4/ext/iconv/iconv.c:129: error: (Each undeclared identifier is reported only once
/usr/local/src/php-4.3.4/ext/iconv/iconv.c:129: error: for each function it appears in.)
/usr/local/src/php-4.3.4/ext/iconv/iconv.c: In function `php_iconv_string':
/usr/local/src/php-4.3.4/ext/iconv/iconv.c:272: warning: passing arg 2 of `iconv' from incompatible pointer type
make: *** [ext/iconv/iconv.lo] Error 1



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-16 04:31 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
Here you are:
./configure  --prefix=/opt/php4 --with-apxs=/opt/apache/bin/apxs --sysconfdir=/opt/etc/php4 --with-config-file-path=/opt/etc/php4 --disable-debug --with-gd=shared --with-jpeg-dir=/usr/sfw --with-png-dir=/usr/sfw --with-zlib=shared --with-imap=shared,/usr/local/src/imap-2002e --with-mysql=shared,/opt/mysql --with-mysql-sock=/var/run/mysql/sock --enable-dba=shared --with-db4=shared,/usr/local --with-ndbm=shared --with-ldap=shared,/usr/local --with-openssl=/usr/local/ssl --with-gettext --with-pear --enable-safe-mode --enable-bcmath=shared --enable-calendar=shared --enable-ftp=shared --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-mcrypt=shared --with-xml=shared --with-dom=shared --enable-mime-magic --with-iconv=shared --with-mbstring=all
 [2003-11-16 06:11 UTC] moriyoshi@php.net
Try giving the prefix of iconv library to the configure 
option, like --with-iconv=shared,/usr/local

 [2003-11-16 11:01 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
Why should this be needed. I haven't installed any libiconv in /usr/local. Solaris provides the iconv in libc and the headers are in /usr/include/iconv.h
 [2003-11-17 21:54 UTC] sniper@php.net
see also bug #25281

 [2003-11-24 08:06 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
It's me again.
I just compiled everything static.
running the script form commandline doesn't segfault anymore, but the apache1 module still segfaults!
gdb showed:
(gdb) run -X
Starting program: /opt/apache/bin/httpd -X
warning: Lowest section in /usr/lib/libintl.so.1 is .hash at 00000074
warning: Lowest section in /usr/lib/libintl.so.1 is .hash at 00000074
 
Program received signal SIGSEGV, Segmentation fault.
0xfddb4624 in shutdown_memory_manager (silent=1, clean_cache=18432) at /usr/local/src/php-4.3.4/Zend/zend_alloc.c:531
531                             REMOVE_POINTER_FROM_LIST(t);
(gdb) bt
#0  0xfddb4624 in shutdown_memory_manager (silent=1, clean_cache=18432) at /usr/local/src/php-4.3.4/Zend/zend_alloc.c:531
#1  0xfdd94980 in php_request_shutdown (dummy=0x0) at /usr/local/src/php-4.3.4/main/main.c:1005
#2  0xfddd577c in apache_php_module_main (r=0x0, display_source_mode=-35825944) at /usr/local/src/php-4.3.4/sapi/apache/sapi_apache.c:60
 [2003-11-27 04:40 UTC] sniper@php.net
Try this:

# rm config.cache
# ./configure --with-apxs=/opt/apache/bin/apxs --disable-all
# make clean && make

And as that most likely works fine, add the other options one by one to see which one actually causes the problem.


 [2003-12-02 04:40 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
The problem occurs when enabling iconv or mbstring
 [2003-12-02 05:47 UTC] sniper@php.net
Are you still loading any shared extensions? 
Check your php.ini..

 [2003-12-02 05:55 UTC] sniper@php.net
Also confirm if this configure line works / does not work:

# ./configure --disable-all --with-apxs=/opt/apache/bin/apxs --enable-mbstring=all


 [2003-12-07 12:01 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-12-19 06:20 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
Hi!
Sorry, I had no spare time to do some more debugging. Now back online :-)

I cannot confirm the bug with only using --enable-mbstring or --with-iconv...

I only encounter the bug when testing the horde-Framework from CVS. I was not able to create a php script that crashed. But everytime I call 'php login.php' from horde there is a segfault. the same with the apache 1.x module.

I don't know how to go on.

Yours Joerg
 [2003-12-19 07:55 UTC] sniper@php.net
Come back when you have short example script (other than Horde), or preferrably: Ask the horde authors to come up with the script.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC