From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHG3K-0003nI-QP for qemu-devel@nongnu.org; Thu, 18 Jun 2009 07:45:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHG3J-0003mh-0b for qemu-devel@nongnu.org; Thu, 18 Jun 2009 07:45:09 -0400 Received: from [199.232.76.173] (port=50083 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHG3I-0003mc-IR for qemu-devel@nongnu.org; Thu, 18 Jun 2009 07:45:08 -0400 Received: from lechat.rtp-net.org ([88.191.19.38]:35571) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHG3I-0005U9-2h for qemu-devel@nongnu.org; Thu, 18 Jun 2009 07:45:08 -0400 Received: from lechat.rtp-net.org (localhost [127.0.0.1]) by lechat.rtp-net.org (Postfix) with ESMTP id 18FE710086 for ; Thu, 18 Jun 2009 13:49:56 +0200 (CEST) From: Arnaud Patard (Rtp) Date: Thu, 18 Jun 2009 13:49:55 +0200 Message-ID: <87k539sqvw.fsf@lechat.rtp-net.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: [Qemu-devel] [PATCH] linux-user: increment MAX_ARG_PAGES List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-=-= There's a error When doing something like that : find / -type f -print0 | xargs -0 echo [ done in a arm chroot with qemu-arm and linux binfmt stuff or with find / -type f -print0 | qemu-arm -L /usr/bin/xargs -0 echo ] Doing this outsite qemu is fine. The problem was the huge number of parameters. Increasing MAX_ARG_PAGES is fixing that. While I was at it, I've modified linux-user/main.c to report error code of loader_exec. It helps to debug/know what's wrong. Signed-off-by: Arnaud Patard --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=linux-user_parameter_fix.patch Index: qemu/linux-user/main.c =================================================================== --- qemu.orig/linux-user/main.c +++ qemu/linux-user/main.c @@ -2372,6 +2372,7 @@ int main(int argc, char **argv, char **e envlist_t *envlist = NULL; const char *argv0 = NULL; int i; + int ret; if (argc <= 1) usage(); @@ -2576,9 +2577,10 @@ int main(int argc, char **argv, char **e env->opaque = ts; task_settid(ts); - if (loader_exec(filename, target_argv, target_environ, regs, - info, &bprm) != 0) { - printf("Error loading %s\n", filename); + ret = loader_exec(filename, target_argv, target_environ, regs, + info, &bprm); + if (ret != 0) { + printf("Error %d while loading %s\n", ret, filename); _exit(1); } Index: qemu/linux-user/qemu.h =================================================================== --- qemu.orig/linux-user/qemu.h +++ qemu/linux-user/qemu.h @@ -140,7 +140,7 @@ extern const char *qemu_uname_release; * and envelope for the new program. 32 should suffice, this gives * a maximum env+arg of 128kB w/4KB pages! */ -#define MAX_ARG_PAGES 32 +#define MAX_ARG_PAGES 33 /* * This structure is used to hold the arguments that are --=-=-=--