dotgnu-libjit
[Top][All Lists]
Advanced

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

[Dotgnu-libjit] How Do I Debug a Memory Protection Error?


From: Noah Lavine
Subject: [Dotgnu-libjit] How Do I Debug a Memory Protection Error?
Date: Fri, 15 Oct 2010 23:58:56 -0400

Hello,

I'm getting a bus error when running my program (which uses libjit).
GDB suggests that this is a kernel protection failure on a region of
memory with read and write, but not execute, permission, and that it
happens when I call jit_apply. In fact, I tracked it through libjit to
jit-apply.c line 442 (from a recent git version), which is a call to
jit_builtin_apply. I think what must be happening is that libjit is
putting generated code in memory that does not have executable
permissions.

However, I'm not really sure how to go about debugging this. I tried
replacing jit_malloc_exec with another way to get executable memory,
and I got the same error. Am I on the right track? Is this the
function that allocates memory for generated code? How should I go
about tracking this down? (I'm using Mac OS X 10.6 on an x86-64
computer, by the way. Libjit builds fine and passes all 5 tests.)

Thanks a lot
Noah Lavine



reply via email to

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