From:             
Operating system: Solaris
PHP version:      5.3.5
Package:          ICONV related
Bug Type:         Bug
Bug description:PHP built from source on Solaris gets SIGSEGV with libiconv

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 bug report at http://bugs.php.net/bug.php?id=53844&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53844&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53844&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53844&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53844&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53844&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53844&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53844&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53844&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53844&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53844&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53844&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53844&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53844&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53844&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53844&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53844&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53844&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53844&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53844&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53844&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53844&r=mysqlcfg

Reply via email to