Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 306145 - www-apache/libapreq2: use APR::Request causes Segmentation Fault
Summary: www-apache/libapreq2: use APR::Request causes Segmentation Fault
Status: RESOLVED DUPLICATE of bug 308797
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-21 08:58 UTC by Alex Masidlover
Modified: 2011-05-23 15:09 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Masidlover 2010-02-21 08:58:08 UTC
With www-apache/libapreq2-2.08-r2 installed; use APR::Request causes a Segmenation fault.

Reproducible: Always

Steps to Reproduce:
1. emerge -av libareq2
2. perl -e 'use APR::Request'

Actual Results:  
Segmentation Fault

Expected Results:  
Return to command line with no output.

I have a number of OpenVZ virtual machines (cloned from the same original machine) that run a web application, I have 3 of them working fine in mod_perl, but the one I'm adding mod_perl to currently is behaving very strangely. 

I installed libapreq2 and then went to add CGI::Apache2::Wrapper through CPAN, but it failed - when I built manually it gave me a segfault when doing perl Makefile.PL. By a process of eliminating the 'use' statements that ExtUtils::MakeMaker is running (and the use statements that those modules are doing) I managed to narrow it down to APR::Request (it includes APR::Pool and APR::BucketAlloc but those can be 'used' without probem). Therefore I think it must be the bootstrap in there.

I've run strace on a good machine and the mis-behaving machine; the good machine opens and closes /usr/lib/libapreq2.so.3 does mprotect x 2/munmap then 'exit_group'. The bad machine opens and closes /usr/lib/libapreq2.so.3, then also opens and closes: /usr/lib/libldap-2.4.so.2 and /usr/lib/liblber-2.4.so.2 - it then does mprotect x 4/munmap and seg faults...

The use flags on Apache2, libapreq2, Perl and openldap are the same on both working and non-working machines (as far as I could spot). Obviously I've installed/not-installed something slightly differently, but can't work out what it is...

I can just clone one of the working machines with mod_perl on, but thought it would be best to try and get this fixed properly - not sure what severity to give as for me its 'normal', but if someone with only one machine to use needs libapreq2 and this happens then for them its 'Critical'...

emerge --info
Portage 2.1.7.16 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.27-openvz-briullov.1-r2 x86_64)
=================================================================
System uname: Linux-2.6.27-openvz-briullov.1-r2-x86_64-Intel-R-_Xeon-R-_CPU_E5405_@_2.00GHz-with-gentoo-1.12.13
Timestamp of tree: Sat, 20 Feb 2010 19:00:01 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.5.4-r2, 2.6.4
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.7.9-r1, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /sbin/rc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 ldap mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl sse sse2 ssl sysfs tcpd unicode xorg zlib" 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 authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

End of working stack trace:
open("/usr/lib/libapreq2.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3608\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=55952, ...}) = 0
mmap(NULL, 2151272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f94e66c6000
mprotect(0x7f94e66d3000, 2093056, PROT_NONE) = 0
mmap(0x7f94e68d2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f94e68d2000
close(3)                                = 0
mprotect(0x7f94e68d2000, 4096, PROT_READ) = 0
mprotect(0x7f94e6ae0000, 4096, PROT_READ) = 0
munmap(0x7f94ea17a000, 22001)           = 0
exit_group(0)                           = ?

End of seg faulting stack trace:
open("/usr/lib/libapreq2.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3608\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=55952, ...}) = 0
mmap(NULL, 2151272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f14b7e43000
mprotect(0x7f14b7e50000, 2093056, PROT_NONE) = 0
mmap(0x7f14b804f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f14b804f000
close(3)                                = 0
open("/usr/lib/libldap-2.4.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \346\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=268576, ...}) = 0
mmap(NULL, 2363904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f14b7c01000
mprotect(0x7f14b7c41000, 2093056, PROT_NONE) = 0
mmap(0x7f14b7e40000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3f000) = 0x7f14b7e40000
close(3)                                = 0
open("/usr/lib/liblber-2.4.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0=\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=60208, ...}) = 0
mmap(NULL, 2155720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f14b79f2000
mprotect(0x7f14b7a00000, 2093056, PROT_NONE) = 0
mmap(0x7f14b7bff000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7f14b7bff000
close(3)                                = 0
mprotect(0x7f14b7bff000, 4096, PROT_READ) = 0
mprotect(0x7f14b7e40000, 4096, PROT_READ) = 0
mprotect(0x7f14b804f000, 4096, PROT_READ) = 0
mprotect(0x7f14b825d000, 4096, PROT_READ) = 0
munmap(0x7f14bb6db000, 22587)           = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2011-05-23 15:09:31 UTC
This is duplicate :) I mark this bug as dup, since bug 308797 has solution.

*** This bug has been marked as a duplicate of bug 308797 ***