On 23 Jul 2015, at 19:08, Holger Freyther <holger@freyther.de> wrote:
On 23 Jul 2015, at 14:42, Holger Freyther <holger@freyther.de> wrote:
Am I using NativeBoost correctly here? Do you have any hints? Is the code moving or being garbage collected? Is there an easy way I could proof the theory?
I created a dummy replacement for the C code. It does not touch the âbufâ memory and I still get the SIGILL (though more iterations are needed).
I added a breakpoint in the code that generates the native code and the code is not re-generated. So the memory for the CompiledMethod(?) just appears to change.
It looks like the stack is getting corrupted at some point in time. The code to call my native code appears to remain valid and something else corrupts inside the VM.
any idea of where to move from here?
holger
Did you try the #optMayGC option I suggested? It really looks like the method code may be moved by the GC.
dummy code with no side-effects:
#include <assert.h>
int myRAND_bytes(unsigned char *buf, int num) { assert(buf); return 1; }