[plt-scheme] Interesting Seg-Fault Interfacing With C Code

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Mar 24 12:46:49 EDT 2009

At Mon, 23 Mar 2009 23:02:35 -0400, Will Farr wrote:
> Is it possible for a GC to run while in the dynamic extent of a C  
> extension without a call to SCHEME_USE_FUEL(...), scheme_malloc_...(),  
> scheme_...(), etc, under 3m?
> [...]
> Could it be possible that, on my platform (Mac OS X 10.5, x86, 2  
> CPUs), something is going wrong with scheduling so that a GC could run  
> even while I was in qsort(...), far away from any calls into the  
> runtime? 

No, that should not be possible. Many, many things could go wrong if a
background OS thread triggers a GC.

I don't have an explanation for the behavior that you saw, though. Did
you try setting a breakpoint on garbage_collect() to see if it really
is running during a qsort()?



Posted on the users mailing list.