php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33708 Problem with php module recode
Submitted: 2005-07-14 22:20 UTC Modified: 2005-08-02 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: kirameku at email dot cz Assigned:
Status: No Feedback Package: Recode related
PHP Version: 4CVS, 5CVS (2005-07-19) OS: RedHat ES4 x86_64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kirameku at email dot cz
New email:
PHP Version: OS:

 

 [2005-07-14 22:20 UTC] kirameku at email dot cz
Description:
------------
Problem with php module recode on platform x86_64. 
recode ( string request, string string ) => Segmentation fault.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-15 12:17 UTC] kirameku at email dot cz
-- System Information:
RedHat ES4 (x86_64)
Architecture: x86_64
Kernel: 2.6.9-11.ELsmp


I have php4 compiled with "./configure .. --enable-recode --with-recode ...".


 When I do

$ /usr/bin/php ./test.php
Segmentation fault

and test.php :
<?
  echo recode_string("utf-8..html_4.0","Hello, World !");
?>

I first tought it was a bug on librecode but it works well from the command line :

echo "Hello, World"|recode "utf-8..html_4.0"
Hello, World
 [2005-07-18 10:50 UTC] kirameku at email dot cz
php4.4.0 was compiled with some warnings:

/home/Develop/php-4.4.0/ext/recode/recode.c: In function `zif_recode_string':
/home/Develop/php-4.4.0/ext/recode/recode.c:156: warning: passing arg 5 of `recode_buffer_to_buffer' from incompatible pointer type
/home/Develop/php-4.4.0/ext/recode/recode.c:156: warning: passing arg 6 of `recode_buffer_to_buffer' from incompatible pointer type


recode version: recode-3.6-17, recode-devel-3.6-17

# gdb ./php core.15829 
GNU gdb Red Hat Linux (6.3.0.0-0.31rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

Core was generated by `./php test.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib64/libcrypt.so.1...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libnsl.so.1...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /usr/lib64/librecode.so.0...done.
Loaded symbols for /usr/lib64/librecode.so.0
Reading symbols from /usr/lib64/libpng12.so.0...done.
Loaded symbols for /usr/lib64/libpng12.so.0
Reading symbols from /usr/lib64/libz.so.1...done.
Loaded symbols for /usr/lib64/libz.so.1
Reading symbols from /usr/lib64/libjpeg.so.62...done.
Loaded symbols for /usr/lib64/libjpeg.so.62
Reading symbols from /lib64/libresolv.so.2...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /lib64/tls/libm.so.6...done.
Loaded symbols for /lib64/tls/libm.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libssl.so.4...done.
Loaded symbols for /lib64/libssl.so.4
Reading symbols from /lib64/libcrypto.so.4...done.
Loaded symbols for /lib64/libcrypto.so.4
Reading symbols from /usr/lib64/libgssapi_krb5.so.2...done.
Loaded symbols for /usr/lib64/libgssapi_krb5.so.2
Reading symbols from /usr/lib64/libkrb5.so.3...done.
Loaded symbols for /usr/lib64/libkrb5.so.3
Reading symbols from /lib64/libcom_err.so.2...done.
Loaded symbols for /lib64/libcom_err.so.2
Reading symbols from /usr/lib64/libk5crypto.so.3...done.
Loaded symbols for /usr/lib64/libk5crypto.so.3
Reading symbols from /lib64/tls/libc.so.6...done.
Loaded symbols for /lib64/tls/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libnss_files.so.2...done.
Loaded symbols for /lib64/libnss_files.so.2
#0  0x00000038693b7865 in delmodule_flat () from /usr/lib64/librecode.so.0
(gdb) bt
#0  0x00000038693b7865 in delmodule_flat () from /usr/lib64/librecode.so.0
#1  0x00000038693aa50d in recode_new_task () from /usr/lib64/librecode.so.0
#2  0x00000038693aa82e in recode_perform_task () from /usr/lib64/librecode.so.0
#3  0x00000038693a924c in recode_buffer_to_buffer () from /usr/lib64/librecode.so.0
#4  0x00000000004b78c7 in zif_recode_string (ht=72, return_value=0x9571f8, this_ptr=0x48, return_value_used=9814288)
    at /home/Develop/php-4.4.0/ext/recode/recode.c:156
#5  0x000000000057fc80 in execute (op_array=0x957ad8) at /home/Develop/php-4.4.0/Zend/zend_execute.c:1672
#6  0x000000000056aa5e in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/Develop/php-4.4.0/Zend/zend.c:938
#7  0x000000000053c3d3 in php_execute_script (primary_file=0x7fbffff880) at /home/Develop/php-4.4.0/main/main.c:1751
#8  0x000000000058798d in main (argc=2, argv=0x7fbffff998) at /home/Develop/php-4.4.0/sapi/cli/php_cli.c:828
 [2005-07-18 11:03 UTC] derick@php.net
I would suggest to use iconv() instead of recode - the recode library is quite a mess.
 [2005-07-18 21:51 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

I can not reproduce this with PHP 5.1-dev.
Also, I have GCC-4.0.0, if that makes any difference..

 [2005-07-19 20:58 UTC] sniper@php.net
Please don't attach the same backtrace more than once.
I deleted that comment. You reported that your compiler is:
gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.1)

Try this:

# rm config.cache && ./configure --disable-all --disable-cgi --with-recode
# make clean && make 
# run -r 'echo recode_string("utf-8..html_4.0","Hello, World !");'

 [2005-07-25 18:30 UTC] kirameku at email dot cz
Thank you for your advice, but still not working. => Segmentation fault. It is possible the problem is only on x86_64 architecture.
 [2005-07-25 20:09 UTC] sniper@php.net
Did you try with the PHP 5.1-dev snapshot? I've tested this in x86_64 (dual opteron machine) and it does NOT crash for me. (I have FC4 installed in it though)

 [2005-08-02 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC