speedtables icon indicating copy to clipboard operation
speedtables copied to clipboard

Using a speedtable shared library from two interpreters in the same process leads to a crash

Open lehenbauer opened this issue 9 years ago • 1 comments

All the field names get created as static Tcl_Objs, plus an array of pointers to all the field names plus a default empty string object and a null value object. This causes the objects to get used between the two interprteters, which is a no-no, and will lead to objects getting freed that are still in use by the other interpreter and probably other stuff, resulting in a crash.

These statics need to be bundled up into a struct, allocated and initialized per interpreter and associated with the interpreter using Tcl_SetAssocData and referenced from the interpreter using Tcl_GetAssocData.

This'll be tricky.

lehenbauer avatar Apr 28 '16 04:04 lehenbauer

Is this what the multiterp branch intends to fix? https://github.com/flightaware/speedtables/tree/multiterp

bovine avatar Jun 28 '16 19:06 bovine