Seems the problem is there only if gc_init() is not called, i.e. if the module uses caller's GC. Looks like gc_init() is doing something which should be done in gc.setGChandle() also...