Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C2Z2D-0004c3-Iy for qemu-devel@nongnu.org; Wed, 01 Sep 2004 13:36:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C2Z2C-0004bq-3h for qemu-devel@nongnu.org; Wed, 01 Sep 2004 13:36:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2Z2C-0004bn-1N for qemu-devel@nongnu.org; Wed, 01 Sep 2004 13:36:36 -0400 Received: from [143.106.7.31] (helo=maceio.ic.unicamp.br) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C2Yx1-0006zb-7z for qemu-devel@nongnu.org; Wed, 01 Sep 2004 13:31:15 -0400 Received: from brasilia.ic.unicamp.br (brasilia.ic.unicamp.br [143.106.7.34]) by maceio.ic.unicamp.br (8.11.6/8.11.6) with ESMTP id i81HVBr17384 for ; Wed, 1 Sep 2004 14:31:11 -0300 Received: from localhost (localhost [127.0.0.1]) by brasilia.ic.unicamp.br (Postfix) with ESMTP id 1361C10D623 for ; Wed, 1 Sep 2004 14:31:12 -0300 (BRT) Received: from brasilia.ic.unicamp.br ([127.0.0.1]) by localhost (brasilia.ic.unicamp.br [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11405-03 for ; Wed, 1 Sep 2004 14:31:11 -0300 (BRT) Received: from ltc02.ltc.ic.unicamp.br (tux02.ltc.ic.unicamp.br [143.106.24.32]) by brasilia.ic.unicamp.br (Postfix) with ESMTP id 3FA9810D628 for ; Wed, 1 Sep 2004 14:30:46 -0300 (BRT) From: Rafael =?iso-8859-1?q?=C1vila_de_Esp=EDndola?= Date: Wed, 1 Sep 2004 14:32:40 -0300 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_4egNBz7PDbeQbdX" Message-Id: <200409011432.40742.rafael.espindola@ic.unicamp.br> Subject: [Qemu-devel] USE_CODE_COPY breaks clone Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Boundary-00=_4egNBz7PDbeQbdX Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline The cvs version of qemu (i386->i386) generates a segmentation fault in the emulated code of the attached test program. Commenting the definition of USE_CODE_COPY make the test execute successfully. I think that the problem is in the fact that cpu_init is called in the parent process and this functions calls modify_ldt. Where can I found some documentation about modify_ldt? What is USE_CODE_COPY supposed to do? I will try to call cpu_init from within the new thread and see if it works. One more question: What do you think about breaking the do_fork function in do_fork, do_clone and do_vfork? Presently it tries to guess if it should call fork or clone, but do_syscall knows the answer :) Thanks for any comment, Rafael --Boundary-00=_4egNBz7PDbeQbdX Content-Type: text/x-csrc; charset="us-ascii"; name="teste.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="teste.c" #include #include #include #include int f(void *oie) { printf("%s\n",(char *)oie); return 0; } int main() { const int stack_size = 8192; int ret; void *buf = malloc(stack_size); void *buff_end = buf + stack_size; unsigned int flags =CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND; char msg[] = "tata"; ret = clone(f, buff_end, flags, (void *) msg); assert(ret != -1); printf("blit\n"); return 0; } --Boundary-00=_4egNBz7PDbeQbdX--