Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 300679 - sys-apps/sandbox: libsandbox.c:resolve_path() fails under linux-user arm qemu
Summary: sys-apps/sandbox: libsandbox.c:resolve_path() fails under linux-user arm qemu
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 09:41 UTC by Marat Radchenko
Modified: 2021-11-03 00:15 UTC (History)
8 users (show)

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


Attachments
emerge --info (emerge-info,3.00 KB, text/plain)
2010-01-12 09:42 UTC, Marat Radchenko
Details
build.log (build.log,3.58 KB, text/plain)
2010-01-12 09:45 UTC, Marat Radchenko
Details
build.log of chromium (build.log,719.28 KB, text/x-log)
2011-05-11 16:22 UTC, Marco Squarcina
Details
emerge --info (emerge_info.txt,4.31 KB, text/plain)
2011-05-11 16:23 UTC, Marco Squarcina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marat Radchenko 2010-01-12 09:41:52 UTC
build.log and output of emerge --info attached.

qemu version: 0.12.1, set up as documented on http://slonopotamus.org/gentoo-on-n8x0/qemu

I'd attach coredump but have no idea where it is created.
Comment 1 Marat Radchenko 2010-01-12 09:42:45 UTC
Created attachment 216188 [details]
emerge --info
Comment 2 Marat Radchenko 2010-01-12 09:45:22 UTC
Created attachment 216190 [details]
build.log
Comment 3 Bernard Cafarelli gentoo-dev 2010-01-13 09:58:02 UTC
CC-ing arm on this one, armin76 any thoughts?
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2010-01-22 18:18:42 UTC
Well no clue...could be qemu's fault, could be sandbox...

With FEATURES="-sandbox" the user says it works...he also said he's going to try different qemu versions, so we'll see...
Comment 5 Marat Radchenko 2010-01-25 07:17:36 UTC
Breaks same way under 0.12.2.

Tried 0.11.1, got something different:
malloc() ../../sandbox-1.6/libsandbox/libsandbox.c:resolve_path():185: malloc(8192) failed: Unknown error 4096
qemu: uncaught target signal 6 (Aborted) - core dumped
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (815320 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6
Comment 6 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-01-26 10:34:59 UTC
This may be a sandbox or qemu problem.
Comment 7 SpanKY gentoo-dev 2010-01-26 18:31:03 UTC
chromium needs to run qemu to build  ?  seems kind of lame.

does it only fail with the live scm version ?
Comment 8 Marat Radchenko 2010-01-27 11:46:20 UTC
(In reply to comment #7)
> chromium needs to run qemu to build  ?  seems kind of lame.
> 
> does it only fail with the live scm version ?
> 
Maybe i wasn't specific enough... I'm running armv6j gentoo stage in qemu on x86_64 box.

Only live fails because other versions do not use rsync. Disabling sandbox allows chromium to build.

That means one of:
1. qemu is broken
2. rsync is broken
3. sandbox is broken
4. other

I happily built lots of other stuff ( http://slonopotamus.org/Packages ) in that setup (and regularly sync portage tree) without any problems.

Tried to manually run rsync inside sandbox (sandbox rsync -r /usr/portage/distfiles/svn-src/chromium/src/ /tmp/chromium/), got following (two attempts):
ISE rename(printing/.svn/text-base/.printing_context_linux.cc.svn-base.vFnXvG): Bad address
        abs_path: (null)
        res_path: /tmp/chromium/printing/.svn/text-base/.printing_context_linux.cc.svn-base.vFnXvG
/usr/lib/libsandbox.so[0x420952d8]
qemu: uncaught target signal 6 (Aborted) - core dumped
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (853301 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

More additional info: it fails on same file with fixed set of files (i.e. without doing svn up).

And more: when running in sandbox, rsync process slowly grows in size up to ~220MB VIRT / 30MB RES, while rsync without sandbox runs in almost constant memory at ~190MB VIRT / 8MB RES.
Comment 9 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-03-21 18:46:49 UTC
Kicking this to sandbox. If you don't have any idea what causes the problem, please kick to qemu.
Comment 10 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-06-05 08:24:39 UTC
Marat, it would be interesting to see if that can be reproduced with sys-apps/sandbox-2.2. Could you try?
Comment 11 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-07-17 19:50:20 UTC
Marat, please re-open if sandbox-2.2 doesn't solve the problem.
Comment 12 Marat Radchenko 2011-03-12 18:11:16 UTC
Sorry for a long delay, was kinda busy last time :)

# equery l sandbox
[ Searching for package 'sandbox' in all categories among: ]
 * installed packages
[I--] [  ] sys-apps/sandbox-2.4 (0)

Found even easier way to reproduce - install qemu, download gentoo armv6j stage3, setup chroot as documented at https://github.com/slonopotamus/n8x0-overlay/wiki/qemu , try `emerge gcc` (fails during src_unpack, but happily compiles gcc with FEATURES=-sandbox, 100% reproduceable):

>>> Unpacking source...
>>> Unpacking gcc-4.4.5.tar.bz2 to /var/tmp/portage/sys-devel/gcc-4.4.5/work
malloc() ../../sandbox-2.4/libsandbox/libsandbox.c:resolve_path():263: malloc(8192) failed: Cannot allocate memory
qemu: uncaught target signal 6 (Aborted) - core dumped
/usr/lib/portage/bin/ebuild.sh: line 363:  3612 Broken pipe             $1 -c -- "$srcdir$x"
      3613 Aborted                 | tar xof -
 * ERROR: sys-devel/gcc-4.4.5 failed:
 *   failure unpacking gcc-4.4.5.tar.bz2

Tried different qemu versions (qemu-0.11.1  qemu-0.12.0  qemu-0.12.4  qemu-0.12.5  qemu-0.13.0  qemu-0.14.0)
Comment 13 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2011-03-12 18:37:43 UTC
(In reply to comment #12)
> Found even easier way to reproduce - install qemu, download gentoo armv6j
> stage3, setup chroot as documented at
> https://github.com/slonopotamus/n8x0-overlay/wiki/qemu , try `emerge gcc`
> (fails during src_unpack, but happily compiles gcc with FEATURES=-sandbox, 100%
> reproduceable)

Okay, Chromium team has nothing to do here then. Thank you for finding shorter steps to reproduce.
Comment 14 Marat Radchenko 2011-03-12 20:11:24 UTC
Updated summary
Comment 15 SpanKY gentoo-dev 2011-03-13 20:07:38 UTC
i'm not going to investigate this at all considering it works on real hardware
Comment 16 Marco Squarcina 2011-05-11 16:21:03 UTC
I've a very similar problem emerging chromium on x86 (this is a thinkpad x200, real hw ;) build.log and output of emerge --info attached. When malloc() fails I get this on dmesg:

make[2813] general protection ip:b761bc75 sp:bfe3b6b8 error:0 in libc-2.11.3.so[b75f0000+141000]

Emerging chromium with FEATURES="-sandbox" works fine.

I must also say that I'm starting to suspect that sandbox is triggering a kernel bug because I'm suffering from hard lockups (only!) while compiling with sandbox enabled with both vanilla 2.6.37 and 2.6.38. It's not due to overheating or high system load, it freezes even using a single core at the lowest speed with MAKEOPTS="-j1"
Comment 17 Marco Squarcina 2011-05-11 16:22:23 UTC
Created attachment 272877 [details]
build.log of chromium
Comment 18 Marco Squarcina 2011-05-11 16:23:30 UTC
Created attachment 272879 [details]
emerge --info
Comment 19 Marco Squarcina 2011-05-17 12:11:23 UTC
(In reply to comment #16)
> I've a very similar problem emerging chromium on x86 (this is a thinkpad x200,
> real hw ;) build.log and output of emerge --info attached. When malloc() fails
> I get this on dmesg:
> 
> make[2813] general protection ip:b761bc75 sp:bfe3b6b8 error:0 in
> libc-2.11.3.so[b75f0000+141000]
> 
> Emerging chromium with FEATURES="-sandbox" works fine.
> 
> [...]

Just an additional information: I've tried different vanilla sources from 2.6.34 to 2.6.38, always getting the same error
Comment 20 Marco Squarcina 2011-05-17 16:23:03 UTC
(In reply to comment #19)
> > [...]
> 
> Just an additional information: I've tried different vanilla sources from
> 2.6.34 to 2.6.38, always getting the same error

More infos, I tried every version of sandbox in portage. The chromium problem occurs with sandbox-2.3-r1,  sandbox-2.4 and sandbox-2.5. Everything works fine using sandbox-1.6-r2.
Comment 21 SpanKY gentoo-dev 2021-10-18 05:05:07 UTC
*** Bug 648516 has been marked as a duplicate of this bug. ***
Comment 22 SpanKY gentoo-dev 2021-11-03 00:15:18 UTC
qemu & sandbox have changed significantly in the last decade.  see if it still fails nowadays.