Edit report at http://bugs.php.net/bug.php?id=53844&edit=1

 ID:                 53844
 Updated by:         johan...@php.net
 Reported by:        r at rcrowley dot org
 Summary:            PHP built from source on Solaris gets SIGSEGV with
                     libiconv
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            ICONV related
 Operating System:   Solaris
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Which version of solaris are you using? My Solaris 11 express works
fine. Could you also try doing a



./configure --disable-iconv --with-iconv



build? Yor stacktrace shows 

   #1  0xfe8d68ab in iconv () from /lib/libc.so.1

so the libc's iconv is being used. My assumption is that another library
is using iconv from /opt/local and so the linker pulls the libs in the
wrong order so one version is used for compiling PHP the other for
running ...


Previous Comments:
------------------------------------------------------------------------
[2011-02-07 17:16:45] r at rcrowley dot org

# iconv --version

iconv (GNU libiconv 1.11)

Copyright (C) 2000-2007 Free Software Foundation, Inc.

License GPLv2+: GNU GPL version 2 or later
<http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Written by Bruno Haible.

# pkgin list | grep iconv

libiconv-1.12nb1     Character set conversion library

#

------------------------------------------------------------------------
[2011-02-01 21:48:13] jacq...@php.net

Hi Richard,



Can you confirm which versions of iconv you have installed?



pkg_info | grep iconv



Should give you the information.

------------------------------------------------------------------------
[2011-01-26 08:50:56] r at rcrowley dot org

This problem is not limited to one odd Joyent SmartMachine.  The problem
exists on 

several not quite identical machines.

------------------------------------------------------------------------
[2011-01-26 08:48:40] r at rcrowley dot org

Description:
------------
With PHP built from source on a Joyent SmartMachine and using the
operating 

system's libiconv, simple uses of the PHP iconv function result in
SIGSEGV.



PHP builds without (related) warnings and is linked to the libiconv
shared 

library:



[root@gnp2b7ak ~]# ldd $(which php) | grep iconv

        libiconv.so.2 =>         /opt/local/lib/libiconv.so.2

[root@gnp2b7ak ~]#



We're using the following configuration:



./configure \

        --disable-ctype \

        --disable-dom \

        --disable-fileinfo \

        --disable-flatfile \

        --disable-inifile \

        --disable-ipv6 \

        --disable-memcache-session \

        --disable-phar \

        --disable-posix \

        --disable-session \

        --disable-simplexml \

        --disable-xmlwriter \

        --enable-mbstring \

        --enable-memcache \

        --host=i386-sun-solaris2 \

        --mandir=/opt/local/man \

        --prefix=/opt/local \

        --with-apxs2=/opt/local/apache2/bin/apxs \

        --with-config-file-path=/opt/local/etc \

        --with-curl \

        --with-gd \

        --with-jpeg-dir=/opt/local \

        --with-libxml-dir=/opt/local \

        --with-mcrypt \

        --with-mysql=mysqlnd \

        --with-openssl=/opt/local \

        --with-iconv \

        --without-pdo-sqlite \

        --without-sqlite \

        --without-sqlite3 \

        --with-pdo-mysql=mysqlnd \

        --with-pear \

        --with-png-dir=/opt/local \

        --with-regex=system \

        --with-zlib \

        --with-zlib-dir=/usr

Test script:
---------------
php -r 'echo iconv("UTF-8", "UTF-8", "Hello, world.\n");'

Expected result:
----------------
[root@gnp2b7ak ~]# php -r 'echo iconv("UTF-8", "UTF-8", "Hello,
world.\n");'

Hello, world.

[root@gnp2b7ak ~]#

Actual result:
--------------
[root@gnp2b7ak ~]# php -r 'echo iconv("UTF-8", "UTF-8", "Hello,
world.\n");'

Segmentation Fault (core dumped)

[root@gnp2b7ak ~]#



Note that the iconv(1) program works fine:



[root@gnp2b7ak ~]# echo "Hello, world." | /opt/local/bin/iconv -f UTF-8
-t UTF-8

Hello, world.

[root@gnp2b7ak ~]#



(gdb) bt

#0  0xec835356 in ?? ()

#1  0xfe8d68ab in iconv () from /lib/libc.so.1

#2  0x08156b59 in php_iconv_string (in_p=0x860d478 "Hello, world.\n",
in_len=14, 

out=0x80475c0, out_len=0x80475c4, out_charset=0x860d44c "UTF-8", 

    in_charset=0x860e8f4 "UTF-8") at /tmp/tmp.qsay1T/php-

5.3.4/ext/iconv/iconv.c:501

#3  0x08159b1c in php_if_iconv (ht=3, return_value=0x860d490, 

return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)

    at /tmp/tmp.qsay1T/php-5.3.4/ext/iconv/iconv.c:2327

#4  0x082d4cfa in zend_do_fcall_common_helper_SPEC
(execute_data=0x8746430) at 

zend_vm_execute.h:316

#5  0x082d3d79 in execute (op_array=0x860d378) at zend_vm_execute.h:107

#6  0x082a7429 in zend_eval_stringl (str=0x8047d0b "echo
iconv(\"UTF-8\", \"UTF-

8\", \"Hello, world.\\n\");", str_len=48, retval_ptr=0x0, 

    string_name=0x858210c "Command line code") at /tmp/tmp.qsay1T/php-

5.3.4/Zend/zend_execute_API.c:1193

#7  0x082a75e2 in zend_eval_stringl_ex (str=0x8047d0b "echo
iconv(\"UTF-8\", 

\"UTF-8\", \"Hello, world.\\n\");", str_len=48, retval_ptr=0x0, 

    string_name=0x858210c "Command line code", handle_exceptions=1) at 

/tmp/tmp.qsay1T/php-5.3.4/Zend/zend_execute_API.c:1235

#8  0x082a765a in zend_eval_string_ex (str=0x8047580 "\016",
retval_ptr=0x0, 

string_name=0x858210c "Command line code", handle_exceptions=1)

    at /tmp/tmp.qsay1T/php-5.3.4/Zend/zend_execute_API.c:1246

#9  0x08336c40 in main (argc=3, argv=0x8047c24) at /tmp/tmp.qsay1T/php-

5.3.4/sapi/cli/php_cli.c:1282

(gdb)


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53844&edit=1

Reply via email to