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 (:
Created attachment 6543 [details, diff] Patch to make the sandbox work on mips and possibly other archs
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 :)
I can confirm this works on mips
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 ?
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).
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.
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 ....
hasn't this been verified as ok yet, since mholzer now marked it as critical according to my inbox?
is this still a problem ?
no feedback -> closing
Closing again.