Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 12236

Summary: sandbox eating all ram on mips (and other archs?)
Product: Gentoo Linux Reporter: Torgeir Hansen <torgeir>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: VERIFIED TEST-REQUEST    
Severity: critical CC: azarah, cretin, h3y, jrray, pvdabeel, roughneck, seemant
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to make the sandbox work on mips and possibly other archs

Description Torgeir Hansen 2002-12-16 03:13:04 UTC
There is a known issue with libsandbox eating all aviable memory until it dies,
this is true for the mips arch at least, someone mentioned that others (ppc)
have the same problem.
For now the solution is known to be just disabling the sandbox, however I might
have a solution to the problem:

It appears that the problem comes from init_wrappers() not being able to get the
proper true_* funcs, the result is that the true_* points to libsandbox' local
functions which in turn just ends up as an eternal loop eating memory and cpu
until it dies.

I've found that by forcing the BROKEN_RTLD_NEXT define in libsandbox.c
(overriding settings in localdecls.h, set by create-localdecls if i'm not
mistaken) solves the problem.
This should be tested more but at first glance this seems to be the solution.
This can be implemented by altering create-localdecls to use a simple version of
init_wrappers() that does a dlsym() and tests the result for the local pointer,
i.e like this;
if ((void*)dlsym(libc_handle,"chmod") == (void*)chmod) {
  printf("Getting local function handler, try BROKEN_RTLD_NEXT\n");
}
init_wrappers() should also be altered to include this test anyway to avoid
these "weird" errors by eating cpu and memory..

I'll generate some code to back this up later on today, but don't have the time now!

Hope it helps out (:
Comment 1 Torgeir Hansen 2002-12-16 12:28:03 UTC
Created attachment 6543 [details, diff]
Patch to make the sandbox work on mips and possibly other archs
Comment 2 Torgeir Hansen 2002-12-16 12:29:41 UTC
Here's a very simple patch, which should make it simple to add other arch's if
it turns out to fix a problem for others aswell.

I'm playing happily in the sandbox with my mips-based Indy now :)
Comment 3 Nicholas Wourms 2002-12-16 12:31:39 UTC
I can confirm this works on mips 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-16 13:18:54 UTC
Looks fine, applied to CVS.

Gerk, can you confirm that if it works or not on PPC ?

Robert (jrray) .. you still going to commit those fixes of yours ?  Maybe
just do them to -dev and -1.1, and if Possible, and Nick do us another
masked portage for testing this sandbox ?
Comment 5 Mark Guertin 2002-12-16 13:32:07 UTC
Az: Hmm I'll check it out, but afaik sandbox still fails on PPC due to a kernel
issue (dying in the untarring phase) and no one currently uses on PPC (by our
reccomendation due to this).

Comment 6 J Robert Ray 2002-12-16 13:39:19 UTC
I'll commit them in a little bit.  The -1.1 and -dev trees are a little out of
sync so I need to merge them.
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-16 14:05:58 UTC
Robert: I have been keeping them in sync, so dont worry about it.

A bit off the topic ... I added -1.1 and -dev when I did the cleanups to sandbox,
as I did a lot between work/home, and -dev was somewhat broken at stages.  We may
this think about removing -dev, although I dont know how/if Robert want to take
up on maintaining ... if his latest patch solves most issues, etc ...

Gerk:  Running out of memory could be the cause of it dying during untarring ...
       guess its just an issue of how ppc kernel will handle it ....
Comment 8 Torgeir Hansen 2003-09-09 23:33:40 UTC
hasn't this been verified as ok yet, since mholzer now marked it as critical according to my inbox?
Comment 9 Marius Mauch (RETIRED) gentoo-dev 2003-10-06 21:00:31 UTC
is this still a problem ?
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2004-01-11 21:03:26 UTC
no feedback -> closing
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 10:35:44 UTC
Closing again.