<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Filipe,</div><div>I have looked at the lldb-disable-python-interpreter.patch.</div><div><br></div><div>I am unsure as to why we need to have this finer-grained control over disabling the ScriptInterpreter AND/OR the SWIG-stuff. Would we ever want one without the other?</div><div><br></div><div>Also, the patch as-is causes crashes on my setup. Did you notice anything unusual when testing it?</div><div><br></div><div>This is what I get when testing the data formatters (which heavily use Python, so make for a good candidate to detect issues)</div><div><br></div><div><div>egranata:test egranata$ ./dotest.py functionalities/data-formatter/</div><div>LLDB build dir: /Volumes/work/egranata/lldb.patching/build/Debug</div><div>LLDB-131</div><div>Path: /Volumes/work/egranata/lldb.patching</div><div>URL: <a href="https://enrico@llvm.org/svn/llvm-project/lldb/trunk">https://enrico@llvm.org/svn/llvm-project/lldb/trunk</a></div><div>Repository Root: <a href="https://enrico@llvm.org/svn/llvm-project">https://enrico@llvm.org/svn/llvm-project</a></div><div>Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8</div><div>Revision: 152732</div><div>Node Kind: directory</div><div>Schedule: normal</div><div>Last Changed Author: johnny</div><div>Last Changed Rev: 152732</div><div>Last Changed Date: 2012-03-14 11:35:38 -0700 (Wed, 14 Mar 2012)</div><div><br></div><div><br></div><div><br></div><div>Session logs for test failures/errors/unexpected successes will go into directory '2012-03-14-12_20_37'</div><div>Command invoked: python ./dotest.py functionalities/data-formatter/</div><div>compilers=['clang']</div><div><br></div><div>Configuration: arch=x86_64 compiler=clang</div><div>----------------------------------------------------------------------</div><div>Collected 54 tests</div><div><br></div><div>..Fatal Python error: PyThreadState_Get: no current thread</div><div>Abort trap: 6</div></div><div><br></div><div>crash log:</div><div><div>Application Specific Information:</div><div>abort() called</div><div>objc[6529]: garbage collection is OFF</div><div>HandleCommand(command = "type summary add --python-script "return 'Area = ' + str( int(valobj.GetChildMemberWithName('w').GetValue()) * int(valobj.GetChildMemberWithName('h').GetValue()) );" Rectangle -w Category2")</div><div><br></div><div>Thread 0 Crashed:: Dispatch queue: com.apple.main-thread</div><div>0 libsystem_kernel.dylib <span class="Apple-tab-span" style="white-space:pre"> </span>0x00007fff935b623a __pthread_kill + 10</div><div>1 libsystem_c.dylib <span class="Apple-tab-span" style="white-space:pre"> </span>0x00007fff8db08830 pthread_kill + 90</div><div>2 libsystem_c.dylib <span class="Apple-tab-span" style="white-space:pre"> </span>0x00007fff8db52631 abort + 143</div><div>3 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad93e9a Py_FatalError + 49</div><div>4 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad92360 PyThreadState_Get + 28</div><div>5 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad8df06 Py_InitModule4_64 + 58</div><div>6 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010bdcae32 init_lldb + 82 (LLDBWrapPython.cpp:47759)</div><div>7 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cf8724f lldb_private::ScriptInterpreterPython::InitializePrivate() + 239 (ScriptInterpreterPython.cpp:1897)</div><div>8 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cf86cda lldb_private::ScriptInterpreterPython::ScriptInterpreterPython(lldb_private::CommandInterpreter&) + 426 (ScriptInterpreterPython.cpp:257)</div><div>9 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cf86b1d lldb_private::ScriptInterpreterPython::ScriptInterpreterPython(lldb_private::CommandInterpreter&) + 29 (ScriptInterpreterPython.cpp:305)</div><div>10 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cf79fc9 lldb_private::CommandInterpreter::GetScriptInterpreter() + 185 (CommandInterpreter.cpp:2366)</div><div>11 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010d0ecd2c CommandObjectTypeSummaryAdd::Execute_ScriptSummary(lldb_private::Args&, lldb_private::CommandReturnObject&) + 892 (CommandObjectType.cpp:1055)</div><div>12 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010d0ee5ba CommandObjectTypeSummaryAdd::Execute(lldb_private::Args&, lldb_private::CommandReturnObject&) + 58 (CommandObjectType.cpp:1320)</div><div>13 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cec6330 lldb_private::CommandObject::ExecuteWithOptions(lldb_private::Args&, lldb_private::CommandReturnObject&) + 656 (CommandObject.cpp:281)</div><div>14 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010cf75a59 lldb_private::CommandInterpreter::HandleCommand(char const*, bool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) + 7561 (CommandInterpreter.cpp:1540)</div><div>15 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010bcfc23e lldb::SBCommandInterpreter::HandleCommand(char const*, lldb::SBCommandReturnObject&, bool) + 670 (SBCommandInterpreter.cpp:97)</div><div>16 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010bdf28f2 _wrap_SBCommandInterpreter_HandleCommand__SWIG_1 + 626 (LLDBWrapPython.cpp:8667)</div><div>17 _lldb.so <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010bd487c1 _wrap_SBCommandInterpreter_HandleCommand + 465 (LLDBWrapPython.cpp:8702)</div><div>18 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59f62 PyEval_EvalFrameEx + 3557</div><div>19 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>20 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f8cf 0x10ad42000 + 121039</div><div>21 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>22 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>23 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f8cf 0x10ad42000 + 121039</div><div>24 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>25 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>26 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f8cf 0x10ad42000 + 121039</div><div>27 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>28 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f859 0x10ad42000 + 120921</div><div>29 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>30 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>31 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad92d6a 0x10ad42000 + 331114</div><div>32 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>33 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59f72 PyEval_EvalFrameEx + 3573</div><div>34 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>35 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad92d6a 0x10ad42000 + 331114</div><div>36 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>37 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad6e9af 0x10ad42000 + 182703</div><div>38 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>39 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010addf19a 0x10ad42000 + 643482</div><div>40 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>41 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b77d PyEval_EvalFrameEx + 9728</div><div>42 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>43 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f8cf 0x10ad42000 + 121039</div><div>44 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>45 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>46 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f8cf 0x10ad42000 + 121039</div><div>47 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>48 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>49 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad92d6a 0x10ad42000 + 331114</div><div>50 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>51 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59f72 PyEval_EvalFrameEx + 3573</div><div>52 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>53 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad92d6a 0x10ad42000 + 331114</div><div>54 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>55 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad6e9af 0x10ad42000 + 182703</div><div>56 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>57 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010addf19a 0x10ad42000 + 643482</div><div>58 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad516b6 PyObject_Call + 97</div><div>59 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b77d PyEval_EvalFrameEx + 9728</div><div>60 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5f859 0x10ad42000 + 120921</div><div>61 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad5b62a PyEval_EvalFrameEx + 9389</div><div>62 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad59137 PyEval_EvalCodeEx + 1934</div><div>63 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad589a3 PyEval_EvalCode + 54</div><div>64 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad94c60 0x10ad42000 + 339040</div><div>65 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad94d2c PyRun_FileExFlags + 165</div><div>66 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010ad94716 PyRun_SimpleFileExFlags + 410</div><div>67 org.python.python <span class="Apple-tab-span" style="white-space:pre"> </span>0x000000010adb8e1f Py_Main + 2715</div><div>68 libdyld.dylib <span class="Apple-tab-span" style="white-space:pre"> </span>0x00007fff95f497e1 start + 1</div><div><br></div><div>Does your patch depend on having SWIG's thread support? The way we are currently handling the locking issues in Python is by having a Locker class. You can look for samples of its usage throughout ScriptInterpreterPython, but it is basically follows the RIIA concept, and you can pass parameters to the constructor telling it exactly what behavior you need. If there are any specific combinations you think are missing, feel free to suggest and/or code a patch yourself.</div></div><div>In the simplest case, all you need to do to lock other threads out is:</div><div>{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Menlo; font-size: 11px; "> <span style="color: #4f8187">Locker</span> py_lock(<span style="color: #bb2ca2">this</span>);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> //your code here</div><div>}</div><div><br></div><div>Thanks,</div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; -webkit-text-decorations-in-effect: none; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; color: rgb(0, 0, 0); "><i>Enrico Granata</i></div><div style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">✉ egranata@<font class="Apple-style-span" color="#ff230e"></font>.com</div><div>✆ (408) 972-7683</div></div></span></div></span></div></span></span>
</div>
<br></body></html>