[plt-scheme] having some trouble compiling reliable version of extension module for mzscheme3m; suggestions?

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Sun Sep 11 20:01:57 EDT 2005

> > The segfault appears related to my adding of a call to
> > 'scheme_block_until_enable_break' in my linux-sendfile C extension; if
> > I comment that out and force my extension to just block on the socket,
> > then I don't see the segfault.
> When you don't call scheme_block_until_enable_break(), then there's no
> possibility for GC during your C code, so that's why it works.
> When a GC can happen, then you need to cooperate with the 3m collector
> more --- in ways that I really will document soon.

Hi Matthew,

Thanks for the information!  Hmmm... ok, in that case, I'll have to do the
port syncing within mzscheme rather than the C level, at least until I
understand how to make the extension play friendly with the 3m collector.
Not a problem.

Until the documentation is available, maybe I could look at more examples
of 3m extensions that people have written?  Do folks have suggestions of
collections that I could look at for understanding things?

I'm did a quick grep, and see that the 'openssl' collection does a
scheme_block_until_enable_break() in its extension code, so I'll take a
look at that a little later tonight.  But if there are other nice
canonical examples, that would be great.

Again, thanks a lot for your help!

Posted on the users mailing list.