[plt-scheme] Bus error on scheme_initialize

From: Phil Windley (phil at windley.org)
Date: Tue Mar 29 23:33:23 EST 2005

I've been wanting a way to store persistent hashes in Scheme for a 
small project I'm working on.  I found Alex Ott's mzgdbm 
(http://www.cs.utah.edu/plt/develop/).  Its old, but I thought I'd try 
to bring it up to speed.  I've figured out how to build it on OS X with 
MxScheme 299.100, working through a number of problems, but now I'm 
stumped.

When I load the extension, I get a Bus Error.  If I delete all the 
scheme_add_global calls from scheme_initialize, the extension loads 
(but, of course, isn't worth much).  Even adding one back in (and I've 
tried several), gives the Bus Error.  Here's a short example of the 
scheme_initialize file the Bus Errors:

Scheme_Object *scheme_initialize(Scheme_Env *env) {

   Scheme_Object *v;

/* type for GDBM_FILE */
    scheme_gdbm_file_type=scheme_make_type("<gdbm:file>");

/* Exported functions */
    v = scheme_make_prim_w_arity(scheme_gdbm_open, "gdbm:open", 1, 3);
    scheme_add_global("gdbm:open", v, env);


    return scheme_void;
}

So, for the questions:

1.) Is there something obviously dumb about what happening above?

2.) If not, then does just adding the global to the table exercise the 
code for the function tied to the global (gdbm_open in this case) in 
such a way that I should look there for the problem?

3.) Other ideas?

I've tried adding the MZ_GC... macros.  They didn't help.

No doubt lots has changed since version 103, but I'm having trouble 
seeing what might be causing this.

--phil--


Phil Windley
phil at windley.com
http://www.windley.com
http://www.utahpolitics.org
801.368.2115


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Phillip Windley.vcf
Type: text/directory
Size: 252 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20050329/913c9d09/attachment.bin>

Posted on the users mailing list.