Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213528 - dev-lang/php-5.2.6_rc1[-r1] strtolower failure
Summary: dev-lang/php-5.2.6_rc1[-r1] strtolower failure
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-15 20:39 UTC by Togge
Modified: 2008-03-30 12:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
php -i output (php.info.bz2,7.57 KB, text/plain)
2008-03-15 20:40 UTC, Togge
Details
php -i output (php.info,27.18 KB, text/plain)
2008-03-17 17:44 UTC, Togge
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Togge 2008-03-15 20:39:12 UTC
In dev-lang/php-5.2.6_rc1 and -r1 the function strtolower sometimes return "" when used together with the supplied php.ini file.

Here it's seen with squirrelmail. When older php is used (or strtolower commented in html_tag()) pages are rendered correctly but when above version is used pages are rendered with "<>, < xxx" tags, resulting in unreadable pages.
Comment 1 Togge 2008-03-15 20:40:11 UTC
Created attachment 146248 [details]
php -i output
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-03-15 20:48:36 UTC
Please don't attach any tarballs; also post emerge -pv php and emerge --info output and some case to reproduce the issue.
Comment 3 Togge 2008-03-17 17:44:04 UTC
Created attachment 146403 [details]
php -i output

if "mbstring.func_overload" contains 2 (str) and "mb_internal_encoding" is set to pass then strtolower returns empty strings.

Test code
-----
<?php
$str = "table";
echo "Original string: " . $str . "\n";
echo "Before: " . strtolower($str) . " (";
echo mb_internal_encoding() . ")\n";
mb_internal_encoding('pass');
echo "After: " . strtolower($str) . " (";
echo mb_internal_encoding() . ")\n";
?>
>>>>
Original string: table
Before: table (ISO-8859-1)
After:  (pass)
----


$ emerge -pv php
>>> --pretend disables --ask... removing --ask from options.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] dev-lang/php-5.2.6_rc1-r1  USE="apache2 berkdb bzip2 cgi cli crypt ctype curl force-cgi-redirect ftp gd gdbm iconv imap ipv6 ldap mysql ncurses nls pcre readline reflection session spell spl sqlite ssl truetype unicode xml xsl zlib -adabas -bcmath -birdstep -calendar -cdb -cjk -concurrentmodphp -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -frontbase -gd-external -gmp -hash -inifile -interbase -iodbc (-java-external) -json -kerberos -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -yaz -zip -zip-external"


$ sudo \emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-hardened-r7 i686)
=================================================================
System uname: 2.6.23-hardened-r7 i686 Pentium III (Coppermine)
Timestamp of tree: Sun, 16 Mar 2008 04:30:06 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.5.1-r5
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium3 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/init.d /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
FEATURES="ccache distcc distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/www/localhost/htdocs/pub/gentoo/portage-overlay/local-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi apache apache2 authdaemond bash-completion berkdb bzip2 cli cracklib crypt curl cvsgraph dri enscript fam font-server gdbm geoip gif gpm iconv idn imap ipv6 isdnlog java javascript jpeg libwww maildir midi mime mmx mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl php png pppd python readline reflection ruby sasl session spell spl ssl symlink tcltk tcpd tiff unicode x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_default authn_file authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias asis log_forensic" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="none dummy nvidia"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Christian Hoffmann (RETIRED) gentoo-dev 2008-03-30 12:27:10 UTC
I had a look at it and it seems this is by intention. Apparently previous versions did not take "auto" or "pass" in account properly and that's why it worked before.
I think I even found the "offending" commit [1].

Short reproduce code:
$ php -d mbstring.internal_encoding=pass -d mbstring.func_overload=2 -r 'var_dump(strtolower("ABC"));'
Warning: mb_strtolower(): Unknown encoding "(null)" in Command line code on line 1
bool(false)

I'd say this is a config issue and you have to set a sane default encoding. I don't have a strong opinion on this anyway, and if you disagree, please open a upstream bug [2] and post the URL here. I did not try with vanilla PHP, but as we are not applying any mbstring-related patches and as I found the (probably) related commit I doubt it is Gentoo-specific.


[1] http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.27&r2=1.224.2.22.2.28
[2] http://bugs.php.net/