lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Broken jump patching on x86_64


From: Paolo Bonzini
Subject: Re: [Lightning] Broken jump patching on x86_64
Date: Sun, 08 Jun 2008 16:11:02 -0700
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)


    jit_insn codeBuffer[1024];
    struct jit_state _jit;
    struct foo as;

This code generates broken machine code on x86_64. It's pretty much
random what it produces. The resulting code might contain illegal
instructions or just jump wildly, causing segfaults or cause floating
point exceptions.. anyways completely undefined. What's funny is that if
CRASH is defined to 0, it does not crash. It also does not crash if
"struct foo as" is static. Can anyone confirm these issues? I don't
really know what information I can provide that might be helpful.

What happens if you:

1) add a "memset (&as, 0, sizeof (as));"

2) change _jit's definition to "(as.current)" with parentheses?

Thanks,

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]