Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250627 - www-servers/cherokee-0.9.0 sandbox violation
Summary: www-servers/cherokee-0.9.0 sandbox violation
Status: RESOLVED DUPLICATE of bug 249496
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: José Alberto Suárez López (RETIRED)
URL:
Whiteboard:
Keywords:
: 294771 356911 394593 (view as bug list)
Depends on: 249496
Blocks:
  Show dependency tree
 
Reported: 2008-12-11 17:41 UTC by Juanlu Pérez
Modified: 2011-12-15 17:37 UTC (History)
8 users (show)

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


Attachments
sandbox log (sandbox-12650.log,39 bytes, text/plain)
2008-12-11 17:43 UTC, Juanlu Pérez
Details
sandbox log (build.log,158.41 KB, text/plain)
2009-06-12 17:15 UTC, Juanlu Pérez
Details
strace -o php-cgi-strace.txt php-cgi -v -d session.save=/tmp (php-cgi-strace.txt,72.34 KB, text/plain)
2009-11-27 15:34 UTC, Juanlu Pérez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juanlu Pérez 2008-12-11 17:41:59 UTC
During configure:

checking for php-cgi... /usr/bin/php-cgi
checking /usr/bin/php-cgi supports FastCGI... ACCESS DENIED  open_wr:   /usr/share/snmp/mibs/.index
yes
checking module "error_redir"... dynamic

Later I got a sandbox violation warning:
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/var/log/sandbox/sandbox-12650.log"

open_wr:   /usr/share/snmp/mibs/.index
--------------------------------------------------------------------------------


Reproducible: Always

Steps to Reproduce:
1. emerge -u cherokee
2.
3.

Actual Results:  
sandbox access violation

Expected Results:  
to update cherokee from 0.8.1 to 0.9.0

sandbox-12650.log attached
Comment 1 Juanlu Pérez 2008-12-11 17:43:11 UTC
Created attachment 174975 [details]
sandbox log
Comment 2 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-12-14 17:39:59 UTC
I tried every possible combination of USE flags etc. and I cannot reproduce. This bug needs deeper investigation. Please, also, paste the output of "equery belongs /usr/share/snmp" .( equery is part of app-portage/gentoolkit. )
Comment 3 Juanlu Pérez 2008-12-14 21:42:27 UTC
(In reply to comment #2)
> I tried every possible combination of USE flags etc. and I cannot reproduce.
> This bug needs deeper investigation. Please, also, paste the output of "equery
> belongs /usr/share/snmp" .( equery is part of app-portage/gentoolkit. )
> 

 # equery belongs /usr/share/snmp 
[ Searching for file(s) /usr/share/snmp in *... ]
net-analyzer/net-snmp-5.4.2.1 (/usr/share/snmp)
Comment 4 José Alberto Suárez López (RETIRED) gentoo-dev 2008-12-26 08:52:01 UTC
do you have this problem in 0.11.6 too?
Comment 5 Juanlu Pérez 2008-12-26 15:44:41 UTC
(In reply to comment #4)
> do you have this problem in 0.11.6 too?
> 

0.11.6 is not in portage.
Comment 6 José Alberto Suárez López (RETIRED) gentoo-dev 2008-12-29 12:37:26 UTC
try again, mirrors take some time to sync
Comment 7 johnny 2008-12-30 19:58:44 UTC
(In reply to comment #6)
> try again, mirrors take some time to sync
> 

this bug is only reproducible with php-cgi installed.

cherokee's configure script greps the output of php-cgi -v looking for fcgi. this generates a session_mm.fcgi file which breaks out of gentoo's sandboxing

there are two possible solutions for this that i can see

1. addpredict for this session_mm file (luckily it doesn't contain random numbers)

2. patch out the detection and use a use flag to add php to the default config

3. patch out the detection and leave php in unconditionally
Comment 8 johnny 2008-12-30 19:59:36 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > try again, mirrors take some time to sync
> > 
> 
> this bug is only reproducible with php-cgi installed.
> 
reproducible for me that is :)
Comment 9 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-01-03 21:18:41 UTC
IMHO this bug is an exact dupe of 216346 - both involve php. comment #7 has good analysis i think...
Comment 10 johnny 2009-02-03 17:52:15 UTC
the php portion of this bug is now fixed upstream

I'd suggest that folks see if they still get any snmp errors after
the next ebuild comes
Comment 11 José Alberto Suárez López (RETIRED) gentoo-dev 2009-04-01 12:55:08 UTC
if the new versino have this problem reopen the bug.
thanks
Comment 12 Brent Hagany 2009-04-08 18:19:38 UTC
> if the new versino have this problem reopen the bug.

I have php-cgi 5.2.8-r2 installed and I am getting this error trying to install cherokee 0.99.9
Comment 13 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-04-10 10:03:57 UTC
reopen bug.
Comment 14 Juanlu Pérez 2009-06-12 17:12:14 UTC
I had this bug again in cherokee-0.99.15

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-31141.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/share/snmp/mibs/.index
A: /usr/share/snmp/mibs/.index
R: /usr/share/snmp/mibs/.index
C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
--------------------------------------------------------------------------------

>>> Failed to emerge www-servers/cherokee-0.99.15, Log file:

>>>  '/var/tmp/portage/www-servers/cherokee-0.99.15/temp/build.log'
Comment 15 Juanlu Pérez 2009-06-12 17:15:22 UTC
Created attachment 194432 [details]
sandbox log
Comment 16 José Alberto Suárez López (RETIRED) gentoo-dev 2009-06-22 06:33:17 UTC
I can't reproduce this bug, try new version in portage 0.99.17
Comment 17 Tom Flair 2009-09-16 15:11:30 UTC
(In reply to comment #16)
> I can't reproduce this bug, try new version in portage 0.99.17
> 

Cherokee-0.99-22 from portage appears to have this bug, but renaming it to the current 0.99.24 version works for me.
Comment 18 Juanlu Pérez 2009-11-26 18:58:41 UTC
Here we go again with the same problem, I need to understand why it happens.

>>> Source compiled.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-30710.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/share/snmp/mibs/.index
A: /usr/share/snmp/mibs/.index
R: /usr/share/snmp/mibs/.index
C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
--------------------------------------------------------------------------------

>>> Failed to emerge www-servers/cherokee-0.99.24, Log file:

>>>  '/var/tmp/portage/www-servers/cherokee-0.99.24/temp/build.log'


This is how I try to install:
# emerge --buildpkgonly '='cherokee-0.99.24 -pv

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

Calculating dependencies... done!
[ebuild     U ] www-servers/cherokee-0.99.24 [0.99.15] USE="admin fastcgi%* mysql nls%* pam ssl threads -coverpage -debug -ffmpeg -geoip -ipv6 -ldap -static" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB

I'm not used to deal with sandbox, so I have no idea about how to solve this. Any clue is appreciated.
Comment 19 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-11-27 13:13:56 UTC
*** Bug 294771 has been marked as a duplicate of this bug. ***
Comment 20 Juanlu Pérez 2009-11-27 15:12:05 UTC
# emerge -pv cherokee

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

Calculating dependencies... done!
[ebuild     U ] www-servers/cherokee-0.99.24 [0.99.15] USE="admin fastcgi%* mysql nls%* pam ssl threads -coverpage -debug -ffmpeg -geoip -ipv6 -ldap -static" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB
Comment 21 Juanlu Pérez 2009-11-27 15:14:35 UTC
# emerge --info
Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.29-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.29-gentoo-r5-i686-Pentium_III_-Coppermine-with-gentoo-1.12.13
Timestamp of tree: Fri, 27 Nov 2009 04:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:     4.0_p28
dev-lang/python:     2.4.6, 2.5.4-r3, 2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distcc distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://gentoo-euetib.upc.es/mirror/gentoo/"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j6"
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"
Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6
.29-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.29-gentoo-r5-i686-Pentium_III_-Coppermine-with-gentoo-1.
12.13
Timestamp of tree: Fri, 27 Nov 2009 04:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:     4.0_p28
dev-lang/python:     2.4.6, 2.5.4-r3, 2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
Comment 22 Juanlu Pérez 2009-11-27 15:34:21 UTC
Created attachment 211337 [details]
strace -o php-cgi-strace.txt php-cgi -v -d session.save=/tmp

I attached a "php-cgi -v -d session.save=/tmp" strace. This is the command run by configure. Sandbox says that this command accesses to /usr/share/mibs/.index to write. But as I see in strace it just accesses with O_RDONLY.
Comment 23 Juanlu Pérez 2009-11-27 17:28:13 UTC
I could install cherokee-0.9.24 with no fastcgi USE flag.
It is a workaround but It would be emerged with fastcgi support if we need this.
Comment 24 Allen Parker 2010-03-25 12:54:25 UTC
Yay.

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-22716.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/share/snmp/mibs/.index
A: /usr/share/snmp/mibs/.index
R: /usr/share/snmp/mibs/.index
C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
--------------------------------------------------------------------------------
Comment 25 Jesse Adelman 2010-04-10 01:48:51 UTC
Sanbox violation the same as above, with newer version of cherokee.

>>> Source compiled.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-22261.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/share/snmp/mibs/.index
A: /usr/share/snmp/mibs/.index
R: /usr/share/snmp/mibs/.index
C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
--------------------------------------------------------------------------------

>>> Failed to emerge www-servers/cherokee-0.99.42, Log file:
Comment 26 Joost Ruis 2010-04-24 07:53:41 UTC
>>> Source compiled.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-9041.log"

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/share/snmp/mibs/.index
A: /usr/share/snmp/mibs/.index
R: /usr/share/snmp/mibs/.index
C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
--------------------------------------------------------------------------------

>>> Failed to emerge www-servers/cherokee-0.99.44, Log file:

>>>  '/var/lib/entropy/logs/www-servers:cherokee-0.99.44:20100424-080110.log'
Comment 27 Juanlu Pérez 2010-04-26 00:19:43 UTC
Try to deactivate fastcgi USE flag for cherokee.

(In reply to comment #26)
> >>> Source compiled.
> --------------------------- ACCESS VIOLATION SUMMARY
> ---------------------------
> LOG FILE "/var/log/sandbox/sandbox-9041.log"
> 
> VERSION 1.0
> FORMAT: F - Function called
> FORMAT: S - Access Status
> FORMAT: P - Path as passed to function
> FORMAT: A - Absolute Path (not canonical)
> FORMAT: R - Canonical Path
> FORMAT: C - Command Line
> 
> F: open_wr
> S: deny
> P: /usr/share/snmp/mibs/.index
> A: /usr/share/snmp/mibs/.index
> R: /usr/share/snmp/mibs/.index
> C: /usr/bin/php-cgi -v -d session.save_path=/tmp 
> --------------------------------------------------------------------------------
> 
> >>> Failed to emerge www-servers/cherokee-0.99.44, Log file:
> 
> >>>  '/var/lib/entropy/logs/www-servers:cherokee-0.99.44:20100424-080110.log'
> 

Comment 28 James Gilliland 2010-07-12 14:03:06 UTC
removing fastcgi had no impact for me on 1.0.5. It seems from what I can tell that unrelated to fastcgi use flag, the cherokee script will call php to see if its fastcgi compatible? Doesn't really make sense to me but I had remove snmp support from php to get it updated.
Comment 29 José Alberto Suárez López (RETIRED) gentoo-dev 2011-02-22 21:33:18 UTC
Maybe php herd can help on this. :)
Comment 30 Ole Markus With (RETIRED) gentoo-dev 2011-02-23 09:20:17 UTC
(In reply to comment #29)
> Maybe php herd can help on this. :)
> 

This is a general issue with binaries linking to snmp. We had to add an "addpredict /usr/share/snmp/mibs/.index" to the PHP ebuilds because of this. You can see more details in bug 324739.
Comment 31 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2011-03-01 21:15:22 UTC
*** Bug 356911 has been marked as a duplicate of this bug. ***
Comment 32 Ole Markus With (RETIRED) gentoo-dev 2011-03-05 21:17:48 UTC
It is not much that can be done about this from the PHP side. The only solution I know of to this problem is to use addpredict. Sorry.
Comment 33 A Collector 2011-03-09 15:31:54 UTC
I'm the person who opened Bug 356911 

The solution which worked for me: change the session directory from /tmp to /dev/shm by adding (or changing) the following line:

session.save_path = "/dev/shm"

It should also make sessions go much faster if you have enough memory available.

Good luck :)
Comment 34 Jeroen Roovers (RETIRED) gentoo-dev 2011-03-25 15:37:16 UTC

*** This bug has been marked as a duplicate of bug 249496 ***
Comment 35 Dustin 2011-04-28 02:49:42 UTC
This bug affected me after emerging cherokee-1.2.1

I emerged it once with no problems.

I emerged PHP afterward.. no problems.

For unrelated purposes, I unmerged cherokee and then attempted to emerge it again, and the above problem occured.

Comment #5 was a good workaround for me.
Comment 36 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-15 17:37:04 UTC
*** Bug 394593 has been marked as a duplicate of this bug. ***