Subject: | The garbage collection is not perfect |
In the file JavaScript.xs there are calls to the libjs garbage collection function JS_GC. Sometimes the call to JSVALToSV in the typemap file is executed _after_ this call to JS_GC, using a pointer "cx->cx" that is freed by JS_GC. This results in a segmentation fault.
A solution that seems to work is to move the call to JS_GC into the typemap file, after the call to JSVALToSV.