Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 460836 - dev-php/pecl-radius-1.2.5-r2 segfault in apache
Summary: dev-php/pecl-radius-1.2.5-r2 segfault in apache
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL: https://bugs.php.net/bug.php?id=60885
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-03-08 23:12 UTC by Giorgio
Modified: 2013-03-29 20:51 UTC (History)
0 users

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


Attachments
radius.c patch (radius.patch,288 bytes, patch)
2013-03-08 23:23 UTC, Giorgio
Details | Diff
Ebuild to apply the patch (pecl-radius-1.2.5-r3.ebuild,819 bytes, text/plain)
2013-03-08 23:24 UTC, Giorgio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giorgio 2013-03-08 23:12:08 UTC
From apache error log:

child pid 9122 exit signal Segmentation fault (11)

This happens calling 'radius_create_request($radius,RADIUS_ACCESS_REQUEST)' in a php script.
The same happens using php via cli:

[root@x]# php < testradius.php 
Segmentation fault

[root@x]# gdb php
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 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.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/php...done.
(gdb) r ./testradius.php 
Starting program: /usr/bin/php ./testradius.php
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000000000070ea6c in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff00000000)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/Zend/zend_vm_execute.h:326
326     /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/Zend/zend_vm_execute.h: No such file or directory.
(gdb) bt
#0  0x000000000070ea6c in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff00000000)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/Zend/zend_vm_execute.h:326
#1  0x00000000006b1b6b in execute (op_array=0x10a4020)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/Zend/zend_vm_execute.h:107
#2  0x00000000006908d5 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/Zend/zend.c:1259
#3  0x000000000063e565 in php_execute_script (primary_file=0x7fffffffde10)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/main/main.c:2316
#4  0x0000000000465fc9 in main (argc=2, argv=0x7fffffffe108)
    at /var/tmp/portage/dev-lang/php-5.3.18/work/sapis-build/cli/sapi/cli/php_cli.c:1189
(gdb)

Googling around I've found this bug that seems related:

https://bugs.php.net/bug.php?id=60885

and patching the code of radius.c with the code in the first comment works.
Comment 1 Giorgio 2013-03-08 23:13:04 UTC
[root@x~]# emerge --info
Portage 2.1.11.52 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.7.10-gentoo x86_64)
=================================================================
System uname: Linux-3.7.10-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5530_@_2.40GHz-with-gentoo-2.1
KiB Mem:     1025636 total,    759468 free
KiB Swap:    1048572 total,   1032896 free
Timestamp of tree: Thu, 07 Mar 2013 22:30:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=generic -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -mtune=generic -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://ghost.di.unimi.it/gentoo-portage"
USE="X acl acpi alsa amd64 berkdb bzip2 cli cracklib crypt cxx dbus dri fortran gdbm gpm hal iconv iproute2 ipv6 jpeg logrotate mmx modules mudflap multilib mysql ncurses nls nptl openmp pam pcre png readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" 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" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en it" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="vmware fbdev vesa" 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, USE_PYTHON
Comment 2 Giorgio 2013-03-08 23:23:06 UTC
Created attachment 341350 [details, diff]
radius.c patch
Comment 3 Giorgio 2013-03-08 23:24:04 UTC
Created attachment 341352 [details]
Ebuild to apply the patch
Comment 4 Ole Markus With (RETIRED) gentoo-dev 2013-03-09 15:30:46 UTC
I'll have a look at it as soon as possible
Comment 5 Ole Markus With (RETIRED) gentoo-dev 2013-03-29 20:51:49 UTC
Fixed in CVS