Overview
| Artifact ID: | 36cec2fa9e92cb937b8ef91787397f7c99ec6b47e2fd3fc4eb58c313802e8ce5 |
|---|---|
| Ticket: | b1b2d135818b64c11817013ea8828b298b08a079
Tcl_Eval causes SIGSEGV, Segmentation fault |
| User & Date: | sebres on 2018-01-09 18:04:57 |
Changes
- icomment:
Do you consider the pre-requirements of multi-threaded tcl-execution? - be sure you use threaded-tcl compiled; - Tcl_Obj's are not shared over threads (belong only one thread at the same time); Tcl does not have GIL (e. g. in opposite to python), so you should transfer the "ownership" of an object to calling thread (it is not usable in source thread) or use Tcl_DuplicateObj of it before submitting to another thread; - if you've own complex Tcl_ObjType, you should create safe duplicate mechanism for it's duplication; - execution of Tcl_EvalObjEx can release a tcl-object, if its refCount equal 0 before execution (always use Tcl_IncrRefCount before call it), so if you do Tcl_DecrRefCount hereafter, you can mistakenly free another object that you don't own; - if you have some references in the Tcl_Obj's to several interpreter's (e. g. each thread have more as one interpreter), you should be in the context of this interpreter by the execution (and it is preserved as long as execution takes place); - don't use objects of not thread-safe modules (like "tk") across multiple threads; - you are basically familiar with multi-threaded development (synchronization primitives, etc.); Intrinsically Tcl_ThreadQueueEvent() works fine and is's a part of many internal mechanisms of Tcl (notifier, IO, reflected channels, etc.). Additionally it works fine in tclthread-module (but e. g. also in several other modules of me), so I don't think it has any bug. I believe you do possibly something wrong in your code. It would be nice to have the call-stack on the exception, to do analyze what is wrong there. Without it, it's almost impossible to find something...
- login: "sebres"
- mimetype: "text/plain"
- resolution changed to: "Invalid"