qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] USE_CODE_COPY breaks clone
@ 2004-09-01 17:32 Rafael Ávila de Espíndola
  2004-09-01 23:17 ` Rafael Ávila de Espíndola
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Ávila de Espíndola @ 2004-09-01 17:32 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

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

[-- Attachment #2: teste.c --]
[-- Type: text/x-csrc, Size: 487 bytes --]

#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

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;
}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-01 23:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-01 17:32 [Qemu-devel] USE_CODE_COPY breaks clone Rafael Ávila de Espíndola
2004-09-01 23:17 ` Rafael Ávila de Espíndola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).