qemu-i386 user mode can't fork (bash: fork: Invalid argument) Good time of day everybody, I have been trying to make usermode qemu on ARM with plugapps (archlinux) with archlinux i386 chroot to work. 1. I installed arch linux in a virtuabox and created a chroot for it with mkarchroot. Transferred it to my pogo plug into /i386/ 2. I comiled qemu-i386 static and put it into /i386/usr/bin/ ./configure --static --disable-blobs --disable-system --target-list=i386-linux-user make 3. I also compiled linux kernel 2.6.38 with CONFIG_BINFMT_MISC=y and installed it. uname -a Linux Plugbox 2.6.38 #4 PREEMPT Fri Mar 18 22:19:10 CDT 2011 armv5tel Feroceon 88FR131 rev 1 (v5l) Marvell SheevaPlug Reference Board GNU/Linux 4. Added the following options into /etc/rc.local /sbin/modprobe binfmt_misc /bin/mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc echo ':qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/bin/qemu-i386:' >/proc/sys/fs/binfmt_misc/register 5. Also copied ld-linux.so.3 (actually ld-2.13.so because ld-linux.so.3 is a link to that file) from /lib/ to /i386/lib/ 6.Now i chroot into /i386 and I get this: [root@Plugbox i386]# chroot . [II aI hnve ao n@P /]# pacman -Suy bash: fork: Invalid argument 7.I also downloaded linux-user-test-0.3 from qemu website and ran the test: [root@Plugbox linux-user-test-0.3]# make ./qemu-linux-user.sh [qemu-i386] ../qemu-0.14.0/i386-linux-user/qemu-i386 -L ./gnemul/qemu-i386 i386/ls -l dummyfile BUG IN DYNAMIC LINKER ld.so: dl-version.c: 210: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed! make: *** [test] Error 127 I found some more info about this, however it was on a ppc platform so I don't know if it'll be useful: http://www.powerdeveloper.org/forums/viewtopic.php?p=13709 "I've made some investigations. Seems that the problem is here: clone(18874385,0,0,0,1210087208,1074262024) = -1 errno=22 (Invalid argument) This is a line from qemu-i386 started with -strace option. This error is got by a caller in 3 cases: 1. when child_stack is NULL 2. both CLONE_FS and CLONE_NEWNS flags are set 3. CLONE_THREAD was set, but CLONE_SIGHAND wasn't. I don't know why there is so many params for that command so I need someone more competent than me to comment the situation" I compiled a static bash build. Now there's no weird command prompt, but I still can't execute anything because of fork. [root@Plugbox i386]# chroot . bash-44.# ls bash: fork: Invalid argument bash-44.# a bash: fork: Invalid argument bash-44.# asdf bash: fork: Invalid argument bash-44.# asdf;kalsd;fk bash: fork: Invalid argument bash-44.# exit exit [root@Plugbox i386]# ldd ./bin/bash not a dynamic executable [root@Plugbox i386]# file ./bin/bash ./bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.27, not stripped OK, can you run the following and attach the resulting strace logfiles? strace -ff -o ls-strace.log chroot /i386 /usr/bin/qemu-i386 /bin/ls strace -ff -o bash-strace.log chroot /i386 /usr/bin/qemu-i386 /bin/bash -c /bin/ls (and tell us what the commands print as well). Also can you state exactly which version of qemu you have compiled? Thanks. Hello, [root@Plugbox ~]# strace -ff -o ls-strace.log chroot /i386 /usr/bin/qemu-i386 /bin/ls b? d? e? l? mu-e386i ome oot roc s? u? bin diae hlrc.tin.gar m? o? oot q s? t? v? [root@Plugbox ~]# strace -ff -o bash-strace.log chroot /i386 /usr/bin/qemu-i386 /bin/bash -c /bin/ls /bin/bash: /bin/: %snnca eotcuxe btearinfiy I compiled version 0.14. I also tried the git version. the same result was the same. Also by googling I noticed that many people have the same problem if their CPU architecture is different from x86, and the try to emulate x86. On 28 March 2011 21:13, moonman