Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 45814 - Sandbox is broken on mips
Summary: Sandbox is broken on mips
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: MIPS Linux
: High blocker (vote)
Assignee: MIPS Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-26 08:59 UTC by Dan A. Dickey
Modified: 2010-12-05 20:43 UTC (History)
5 users (show)

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


Attachments
#mipslinux fakeroot discussion (mipslinux-20050411-1313.txt,2.44 KB, text/plain)
2005-04-11 10:38 UTC, Joshua Kinard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan A. Dickey 2004-03-26 08:59:46 UTC
While trying to do a bootstrap from stage1,
during the emerge of ncurses, tic runs out
of memory.

Reproducible: Always
Steps to Reproduce:
1.  From a stage1 on an SGI O2
2.  cd /usr/portage
3.  scripts/bootstrap.sh

Actual Results:  
The bootstrap.sh script failed 

Expected Results:  
It should have finished ok. 

gentoo-mips-20040303 portage # emerge info 
Portage 2.0.50-r1 (default-mips-1.4, gcc-3.3.2, glibc-2.3.2-r3, 
2.6.4-mipscvs-20 
040319-ip32) 
================================================================= 
System uname: 2.6.4-mipscvs-20040319-ip32 mips64 R5000 V2.1  FPU V1.0 
Gentoo Base System version 1.4.3.10 
Autoconf: 
Automake: 
ACCEPT_KEYWORDS="mips ~mips" 
AUTOCLEAN="yes" 
CFLAGS="-O2 -mips4 -mabi=32 -pipe" 
CHOST="mips-unknown-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/ 
config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-O2 -mips4 -mabi=32 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="ccache sandbox" 
GENTOO_MIRRORS="http://gentoo.oregonstate.edu 
http://www.ibiblio.org/pub/Linux/d 
istributions/gentoo" 
MAKEOPTS="-j1" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="berkdb gdbm gpm libwww mips nls pam perl python readline sdl slang ssl 
tcpd 
"
Comment 1 Ciaran McCreesh 2004-03-27 11:46:25 UTC
How much RAM and swap do you have?
Comment 2 Dan A. Dickey 2004-03-29 07:10:58 UTC
After mounting my swap partition, here is /proc/meminfo:
bash-2.05b# cat /proc/meminfo
MemTotal:       149140 kB
MemFree:        138824 kB
Buffers:             4 kB
Cached:           5248 kB
SwapCached:          0 kB
Active:           4144 kB
Inactive:         2168 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       149140 kB
LowFree:        138824 kB
SwapTotal:      751864 kB
SwapFree:       751864 kB
Dirty:               0 kB
Writeback:           0 kB
Mapped:           2624 kB
Slab:             6272 kB
Committed_AS:     1672 kB
PageTables:        120 kB
VmallocTotal:     4096 kB
VmallocUsed:       440 kB
VmallocChunk:     3656 kB

Also note, I'm getting errors from kswapd when tic runs out of memory.
Sorry, I don't presently have this error to show you.  Something along the
lines of that it can't allocate from swap.
Comment 3 Dan A. Dickey 2004-05-06 12:28:14 UTC
Ok.  Found & fixed.
DO NOT TURN ON sandbox IN FEATURES!
With sandbox off, tic works just fine.
Comment 4 Joshua Kinard gentoo-dev 2004-05-06 18:07:58 UTC
We eventually need to get sandbox looked at and fixed.  I'm no sandbox expert however.  If one of the portage people want to take a look at this, I can arrange for access on the spare Indy I have, or if iluxa doesn't mind, access to his O2K system.  Meanwhile, I'll use this bug as a place holder/reminder to get sandbox support looked at.
Comment 5 Ilya Volynets (RETIRED) gentoo-dev 2004-05-17 11:29:44 UTC
It probably would be possible.
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2004-05-18 10:53:07 UTC
The prefered method would be to fix sandbox and not disable it.
Sandbox needs some help with arch-specific code areas.
Comment 7 Brian Harring (RETIRED) gentoo-dev 2004-08-22 05:17:09 UTC
Assuming I could get access to a system for testing, I'd be willing to take a whack at fixing it.
Comment 8 SpanKY gentoo-dev 2004-08-22 10:09:50 UTC
see http://www.gentoo.org/proj/en/infrastructure/dev-machines.xml for contact info for mips
Comment 9 Joshua Kinard gentoo-dev 2005-04-11 10:37:45 UTC
Some updates on a possible cause for this bug based on a conversation in #mipslinux with ths (Thiemo Seufer) on a fix he did for Debian's fakeroot.

Attached as a text file.
Comment 10 Joshua Kinard gentoo-dev 2005-04-11 10:38:21 UTC
Created attachment 56004 [details]
#mipslinux fakeroot discussion
Comment 11 Brian Harring (RETIRED) gentoo-dev 2005-04-13 19:20:41 UTC
What's going on with this beast?
Comment 12 Joshua Kinard gentoo-dev 2005-04-13 19:26:26 UTC
We've actually got a test patch available now that a debian dev worked up to make fakeroot on debian work.  The patch itself is a bit of a hack to glibc, but it seems to get the job done for now until a better solution can be devised.  I've already tested this patch under o32 and n32, and it seems, for the most part, to make sandbox work on mips for the first time.  Glibc seems to still have a problem -- I had a bus error crop up on me in the sunrpc section, which indicates a memory leak or something was still occuring somewheres under sandbox.

I've sent the patch to eradicator already for inclusion in glibc-2.3.5 until the better fix is engineered (likely for binutils).  As for this bug, probably good to keep it open until we manage to get a real fix.
Comment 13 SpanKY gentoo-dev 2008-11-16 17:53:25 UTC
where are these magical patches ?
Comment 14 Joshua Kinard gentoo-dev 2009-02-19 03:57:32 UTC
The old 6645_all_glibc-mips_shn_undef-hack.patch is what the Debian folks used to temporarily resolve their fakeroot problems.  I don't know if they ever worked up a real solution (which was to be done in Binutils).  I don't think I've tried Sandbox is ages.
Comment 15 SpanKY gentoo-dev 2009-03-11 23:33:37 UTC
could you test out latest sandbox (like 1.5) on a mips system ?  i dont have any mips systems up and running and all the ones i had ssh access to seem to be dead
Comment 16 Mark Loeser (RETIRED) gentoo-dev 2009-07-03 23:40:54 UTC
Joshua,

any progress on this?
Comment 17 Mart Raudsepp gentoo-dev 2010-09-19 01:22:08 UTC
I haven't seen any issues on my mipsel n32 yeeloong with sandbox... noticed it's in FEATURES and noticed it under use when cancelling a emerge --regen, so did some tests (and found out it's been in my FEATURES all along):


yeeloong ~ # sandbox
============================= Gentoo path sandbox ==============================
Detection of the support files.
Verification of the required files.
Setting up the required environment variables.
The protected environment has been started.
--------------------------------------------------------------------------------
Process being started in forked instance.

 * Loading sandboxed shell
 *  Log File:           /var/log/sandbox/sandbox-18977.log
 *  Debug Log File:     /var/log/sandbox/sandbox-debug-18977.log
 *  sandboxon:          turn sandbox on
 *  sandboxoff:         turn sandbox off
 *  addread <path>:     allow <path> to be read
 *  addwrite <path>:    allow <path> to be written
 *  adddeny <path>:     deny access to <path>
 *  addpredict <path>:  allow fake access to <path>

[s] yeeloong ~ # cat /etc/gentoo-release 
Gentoo Base System release 2.0.1
[s] yeeloong ~ # adddeny /etc/gentoo-release 
[s] yeeloong ~ # cat /etc/gentoo-release 
ACCESS DENIED  open_rd:      /etc/gentoo-release
cat: /etc/gentoo-release: Permission denied
[s] yeeloong ~ # exit
sandbox:spawn_shell  process returned with failed exit status 1!
Cleaning up sandbox process
============================= Gentoo path sandbox ==============================
The protected environment has been shut down.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-18977.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_rd
S: deny
P: /etc/gentoo-release
A: /etc/gentoo-release
R: /etc/gentoo-release
C: cat /etc/gentoo-release 
--------------------------------------------------------------------------------



yeeloong ~ # sandbox --version
Gentoo path sandbox
 version: 2.2
 C lib:   libc.so.6 (/lib/libc.so.6)
 build:   Jul 25 2010 02:17:26
 contact: sandbox@gentoo.org via http://bugs.gentoo.org/
 rtld:    next is broken ;(
 schizo:  no

configured with these options:
--prefix=/usr --build=mips64el-unknown-linux-gnu --host=mips64el-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib build_alias=mips64el-unknown-linux-gnu host_alias=mips64el-unknown-linux-gnu CFLAGS=-O3 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop LDFLAGS=-Wl,-O1 -Wl,--as-needed CPPFLAGS=


How do I properly test whether it works or not?
I'll check out FEATURES=test on sandbox soon if not told a better way meanwhile (but doesn't hurt either way), sounds like a good way to test, as it's been failing on my x86_64 too :P  Other than that, been emerging things without problems till now.
Comment 18 Mart Raudsepp gentoo-dev 2010-09-19 01:47:35 UTC
Ran tests with an upgrade from 2.2 to sandbox-2.3-r1:


## ------------- ##
## Test results. ##
## ------------- ##

38 tests were successful.
12 tests were skipped.


yeeloong ~ # emerge --info
Portage 2.1.9.7 (!../usr/portage/profiles/default/linux/mips/10.0/lemote/lm2f/yeeloong/n32, gcc-4.4.4, glibc-2.11.2-r0, 2.6.35.4-r0bertz mips64)
=================================================================
System uname: Linux-2.6.35.4-r0bertz-mips64-ICT_Loongson-2_V0.3_FPU_V0.1-with-gentoo-2.0.1
Timestamp of tree: Unknown
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r3, 3.1.2-r4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1::loongson
sys-devel/gcc:       4.4.4-r1::loongson
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.34 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="mips64el-unknown-linux-gnu"
CFLAGS="-O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop -fomit-frame-pointer"
CHOST="mips64el-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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="/home/leio/gentoo/gentoo-x86"
PORTDIR_OVERLAY="/var/lib/layman/loongson"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X berkdb bzip2 cli cracklib crypt cups cxx fortran gdbm gpm iconv ipv6 lm2e lm2f mips modules mudflap n32 ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session ssl sysfs tcpd xorg zlib" 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" ELIBC="glibc" INPUT_DEVICES="synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="siliconmotion fbdev" 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, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 19 Matt Turner gentoo-dev 2010-11-15 05:28:35 UTC
I think you missed this during the compile... :)

../../sandbox-2.3/libsandbox/trace/linux/arch.c:21:3: warning: #warning "trace: sorry, no support for your architecture"

I see that we need to implement what looks to be a pretty trivial piece of code in libsandbox/trace/linux/mips.c, but is there some other component missing? Something about glibc?
Comment 20 SpanKY gentoo-dev 2010-11-15 08:27:34 UTC
no, the trace code is only needed for static tracing via ptrace.  dynamic tracing should work fine.

if all the tests pass, then that's a pretty good indication that things are working ... but only doing full world emerges would tell you otherwise ...
Comment 21 Matt Turner gentoo-dev 2010-12-05 20:43:39 UTC
I've been building stages and testing packages with sandbox enabled and haven't hit any problems. The test suite also passes as mentioned.

I think this is fixed. :)