<i>Tcl_Eval causes SIGSEGV, Segmentation fault</i> status still Open with 3 other changes
by
.
D 2018-01-09T21:37:29.853
J icomment So\sI\ssee\stk\shere.\s\r\n\r\n1.\sIf\syou\scannot\sreproduce\sit\swithout\stk,\sthen\syou\sshould\srather\sopen\sthe\sticket\sby\sthe\stk-repository.\sThis\sone\sis\stcl-repository.\r\n\r\n2.\sAs\sI\salready\swrote\sTk\sis\snot\sthread-safe\s(resp.\snot\scompletely).\r\nSo\sif\syou've\s2\sthreads,\syou\sshould\sorganize\sthe\swork\sas\sfollowing:\r\n\r\n\s\s-\smain-thread\s(using\sTk)\ssends\s"event"\sto\s2nd-thread;\r\n\s\s-\s2nd-thread\s(DON'T\sUSE\sTk)\sdo\ssomething\sand\sanswer\s(e.\sg.\salso\swith\sevent)\r\n\s\s\s\sback\sto\smain-thread;\sNote\syou\scan\suse\sTcl\sthere,\sbut\snot\sTk.\r\n\s\s-\smain-thread\s"draws"\sthe\sresult\swith\sTk.\r\n\r\nNote,\sthat\sonly\sthis\s(main)\sthread\smay\suse\stk,\sbut\snot\sthe\s2nd-thread.\r\nThen\ssegfaults\sare\sthe\sbest\swhat\swill\shappen\shere\s(sometimes\sit\sis\san\sretarded\saftereffect,\sso\sexception\soccurs\smuch\slater,\sthus\sno\schance\sto\sfind\sthe\swrong\spiece).\r\n\r\n3.\sYou\ssaid\sit's\sa\sC++\s(and\syou\scall\syour\sC++\scode\ssomewhere\sfrom\stcl-code)\sand\sthe\sC++\sexception\shandling\sused,\syou\sshould\snecessarily\scatch\sthe\sexception\sstill\sin\sthe\ssame\sC++\scall\s(before\syou\sreturns\sto\stcl-scope),\sI\smean\syou\sshould\snot\straverse\swith\sthe\sexception\sover\ssome\stcl-scope\s(it\swould\sbe\swrong).\r\n\r\nc++_code_1\s{\r\n\s\s...\r\n\s\sc++_try\s{\r\n\s\s\s\s...\r\n\s\s\s\stcl_code\s{\s//\sEval,\sNRE,\sExpr,\sCoroutine,\setc...\r\n\s\s\s\s\s\s...\r\n\s\s\s\s\s\sc++_code_2\s{\r\n\s\s\s\s\s\s\s\sc++_try\s{\r\n\s\s\s\s\s\s\s\s\s\s...\r\n\s\s\s\s\s\s\s\s\s\sc++_throw_except;\s//\sA\sallowed,\sB\swould\sbe\swrong!!!\r\n\s\s\s\s\s\s\s\s\s\s...\r\n\s\s\s\s\s\s\s\s}\sc++_catch\sA\s{};\r\n\s\s\s\s\s\s}\r\n\s\s\s\s}\r\n\s\s}\sc++_catch\sB\s{};\r\n}\r\n\r\nNote:\sc++_code_2\s(inside\stcl-eval)\sCAN'T\sthrow\sC++\sexception\sof\stype\s"B".
J login sebres
J mimetype text/plain
K b1b2d135818b64c11817013ea8828b298b08a079
U sebres
Z dae08e34356ea3d38103688526f1342d