I'm getting occasional (non-reliably-reproducible) seg faults when calling a C 
routine that copies bits from one place to another.

My working assumption is that the buffer is getting moved by GC in between the 
computation of the pointers and the actual ffi invocation, though that's a 
fairly tight window, given that the pointers are computed directly as the 
arguments to the ffi call. I have some questions to see whether I'm 
understanding what's going on:

1) Is it true that GCs cannot occur during the evaluation of ffi code on the 
main thread?
2) Is there any way either to disable GC briefly or to prevent an object from 
being moved?
3) lacking this, (and assuming that #1 is true), it looks like the right thing 
is to use malloc-immobile cell so that the pointer lookup can happen inside of 
the C code. Does this sound correct?

Many thanks,

John

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Reply via email to