Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 359839 - dev-lang/php-5.3.6 crashes in libcurl when trying to fopen a long url
Summary: dev-lang/php-5.3.6 crashes in libcurl when trying to fopen a long url
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 21:18 UTC by Piotr Maksymiuk
Modified: 2011-08-24 08:36 UTC (History)
0 users

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


Attachments
crash on amd64 (amd64crash.log,18.88 KB, text/plain)
2011-03-21 21:20 UTC, Piotr Maksymiuk
Details
crash on x86 (x86crash.log,428 bytes, text/plain)
2011-03-21 21:20 UTC, Piotr Maksymiuk
Details
output of emerge --info (emergeinfo,3.94 KB, text/plain)
2011-03-21 21:21 UTC, Piotr Maksymiuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Maksymiuk 2011-03-21 21:18:14 UTC
When a script in php tries to fopen a URL that is long, it will crash on both in cli and FastCGI. This is of course with allow_url_fopen=true. 

Reproducible: Always

Steps to Reproduce:
1.enable allow_url_fopen in php.ini
2.run php in interactive mode (php -a)
3. try the following code : 
$q = fopen("http://www.google.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'r');
Actual Results:  
Crashes, log attached.

Expected Results:  
it should have not crashed..

I've tried this both on x86 at first, but then i had -fomit-frame-pointer in my CFLAGS, so the only thing i saw was what i posted above.In desperation i redid the system in 64bit, but using mostly the same configs and CFLAGS (adjusted to amd64 of course).The actual URL that i use is a normal url, but it contains private data so i refrained in posting it here.Any info on how to resolve this would be welcome.
Comment 1 Piotr Maksymiuk 2011-03-21 21:20:28 UTC
Created attachment 266763 [details]
crash on amd64
Comment 2 Piotr Maksymiuk 2011-03-21 21:20:50 UTC
Created attachment 266765 [details]
crash on x86
Comment 3 Piotr Maksymiuk 2011-03-21 21:21:18 UTC
Created attachment 266767 [details]
output of emerge --info
Comment 4 Agostino Sarubbo gentoo-dev 2011-03-21 21:50:28 UTC
please not add arch team by yourself
Comment 5 Ole Markus With (RETIRED) gentoo-dev 2011-03-22 16:46:43 UTC
Thanks for reporting. I need to know the output of your `emerge --info php` as well. Also did you check for/report a bug upstream?
Comment 6 Piotr Maksymiuk 2011-03-22 17:54:30 UTC
No, i haven't since this seems more like a glibc bug than php, but i can't really pin it down. I went back to x86 (it's faster), but still experience the bug. I'll recompile glibc and php with -O0 and -ggdb, and provide you with a nice backtrace later on. Here's the output of emerge --info php

Portage 2.1.9.44 (default/linux/x86/10.0, gcc-4.5.2, glibc-2.13-r2, 2.6.37-gentoo-r2 i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.37-gentoo-r2-i686-Intel-R-_Atom-TM-_CPU_D510_@_1.66GHz-with-gentoo-2.0.2
Timestamp of tree: Mon, 21 Mar 2011 00:45:01 +0000
app-shells/bash:     4.2_p8
dev-lang/python:     2.6.6-r2, 2.7.1-r1, 3.1.3-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.68
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.4.5, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.38 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=atom -mfpmath=sse -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=atom -mfpmath=sse -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.ovh.net/gentoo-distfiles/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en pl"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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=""
SYNC="rsync://rsync.fr.gentoo.org/gentoo-portage"
USE="X acl acpi alsa avahi bash-completion berkdb bzip2 cli consolekit cracklib cxx dbus dri fuse gdbm gif gles gnutls gpm graphite iconv idn ipv6 jpeg libedit matroska mmx modules mp3 mudflap ncurses nls nptl nptlonly nss ogg opengl openmp pam pcre perl png policykit pppd python python3 readline session sqlite sse sse2 sse3 ssl sysfs tcpd threads tiff truetype unicode vdpau x264 x86 xattr xorg xvid 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 mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en pl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.3.6 was built with the following:
USE="berkdb bzip2 cgi cli ctype curl curlwrappers exif fileinfo filter ftp gd gdbm hash iconv ipv6 json libedit nls phar posix session simplexml sockets sqlite ssl sysvipc threads tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter xsl zip zlib -adabas -apache2 -bcmath -birdstep -calendar -cdb -cjk -crypt -db2 -dbmaker -debug -doc -embed -empress -empress-bcs -enchant -esoob -firebird -flatfile -fpm -frontbase -gd-external -gmp -imap -inifile -interbase -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -mhash -mssql -mysql -mysqli -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -readline -recode -sapdb -sharedext -sharedmem -snmp -soap -solid -spell -sqlite3 -sybase-ct -tidy -wddx -xpm"
Comment 7 Ole Markus With (RETIRED) gentoo-dev 2011-07-21 07:38:37 UTC
I can no longer reproduce this, even with 5.3.6. I guess the problem was caused outside of the php package.
Comment 8 Matti Bickel (RETIRED) gentoo-dev 2011-08-24 08:36:07 UTC
Closing Works For Me. I couldn't reproduce this on either x86 or amd64 using php-5.3.6. If you happen to experience the bug again, please try to produce a backtrace and reopen the bug.