Hi Pat,<br><br>many thanks for your reply and further thoughts. I haven&#39;t been able to conduct more in-depth debugging yet, but from what you have said I&#39;m not even sure that&#39;s necessary since you say that incompabilities are to be expected anyway.<br>
<br>However, does this mean that using Paraview in conjunction with any other Python-based software that implicitly uses vtk is essentially impossible? Since our code uses dolfin (which is part of the FEniCS package), which imports vtk under the hood, there is no way for us to avoid the conflict between the system-wide vtk module imported by dolfin and Paraview&#39;s internal version. So shouldn&#39;t it be Paraview&#39;s responsibility to make sure that it doesn&#39;t conflict with any other vtk modules? (Not sure if that&#39;s possible at all though.) Otherwise, is there any clean way to &quot;hide&quot; the system vtk from Paraview, even if it&#39;s only imported implicitly via some third-party software?<br>
<br>Many thanks for any further comments and ideas!<br>Max<br><br>P.S.: Once I find the time I&#39;m still happy to dig deeper in to the causes of the segfault, but I&#39;ll wait for confirmation whether it&#39;s worth it or not.<br>
<br><br><div class="gmail_quote">2013/2/1 Pat Marion <span dir="ltr">&lt;<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
See, if you can &quot;import vtk&quot;, then you&#39;re probably importing a version of the vtk libraries that are different than the ones ParaView uses.  What version of ParaView are you using and how did you install ParaView?  Did you build from source, install the binaries from <a href="http://paraview.org" target="_blank">paraview.org</a>, or apt-get install?  And did you install python via apt-get?  What version of ubuntu?<br>


<br>When you run &quot;import vtk&quot; you are indeed importing the system vtk, which is probably v5.8 or v5.10 or something like that.  But ParaView doesn&#39;t use major release versions of vtk, ParaView uses its own copy of VTK which is usually slightly different from the VTK major release versions.<br>


<br>When you run scripts with paraview, most likely you&#39;re going to have to hide the system vtk so that it doesn&#39;t get imported, because most likely it is incompatible with your paraview install.<span class="HOEnZb"><font color="#888888"><br>
<br>Pat</font></span><div class="HOEnZb"><div class="h5"><br><br>

<br><div class="gmail_quote">On Thu, Jan 31, 2013 at 8:52 PM, Maximilian Albert <span dir="ltr">&lt;<a href="mailto:maximilian.albert@gmail.com" target="_blank">maximilian.albert@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi Pat!<br><br>[Apologies for sending you this twice, I accidentally didn&#39;t hit &#39;reply all&#39;.] <br><div><div><br>Many thanks for the detailed reply! Indeed, I&#39;m 
suspecting a conflict between different vtk versions, but I don&#39;t know 
which ones could be the culprits. I&#39;m not sure the issue is actually 
related to the FEniCS package, but will have to find a computer that 
doesn&#39;t have any FEniCS-related packages installed to be sure. The 
reason why I&#39;m saying that is because the segfault already happens when I
 say:<br>
<br>&gt;&gt;&gt; import vtk<br>&gt;&gt;&gt; import paraview.servermanager<br><br>and the following indicates that it loads the system-wide vtk module (not one that comes with FEniCS):<br><br>&gt;&gt;&gt; print vtk.__file__<br>




/usr/lib/pymodules/python2.7/<div>vtk/__init__.pyc<br><br>Out of interest, can you reproduce the segfault on your machine? I presume you don&#39;t have FEniCS installed?<br><br>The
 hints in your email are very helpful, and based on them I&#39;ll try to put
 some more debugging info together as soon as I can (I won&#39;t be able to 
do it before next week, however). Just to answer your questions about my
 setup:<br>
<br>I run my scripts from a regular python interpreter on the command 
line (not from ParaView&#39;s python console or via pvpython). The output of
 sys.path is attached below. I&#39;ll try the LD_DEBUG=lib approach next 
week and will report if I can find anything.<br>
<br>Many thanks again and kind regards,<br>Max<br><br>------------------------------<br>Output of sys.path:<br><br>[&#39;&#39;,<br>&#39;/usr/lib/python2.7&#39;,<br>&#39;/usr/lib/python2.7/plat-linux2&#39;,<br>&#39;/usr/lib/python2.7/lib-tk&#39;,<br>




&#39;/usr/lib/python2.7/lib-old&#39;,<br>&#39;/usr/lib/python2.7/lib-dynload&#39;,<br>&#39;/usr/local/lib/python2.7/dist-packages&#39;,<br>&#39;/usr/lib/python2.7/dist-packages&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/PIL&#39;,<br>




&#39;/usr/lib/python2.7/dist-packages/gst-0.10&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/gtk-2.0&#39;,<br>&#39;/usr/lib/pymodules/python2.7&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/ubuntu-sso-client&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/ubuntuone-client&#39;,<br>




&#39;/usr/lib/python2.7/dist-packages/ubuntuone-control-panel&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/ubuntuone-couch&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/ubuntuone-installer&#39;,<br>&#39;/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol&#39;,<br>




&#39;/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode&#39;]</div><br><br></div></div><div><div><div class="gmail_quote">2013/1/30 Pat Marion <span dir="ltr">&lt;<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>&gt;</span><br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br>It sounds like you probably have multiple versions of the vtk libraries installed someplace in your path.  Maybe the FEniCS package ships it&#39;s own version of the vtk libraries?  If FEniCS imports a different version of vtk, then paraview won&#39;t be able to import vtk within the same memory space, or maybe you can build FEniCS and ParaView to use the same version of vtk.<br>





<br>Are you running this script in ParaView&#39;s python console, or from the command line?  If command line, what interpreter are you using, pvpython, or regular python?<br><br>To collect some more debugging info, in the interpreter print out sys.path and tell us what that says.  Normally, you can&#39;t import vtk from the paraview console, you have to import paraview.vtk.  So if you can import vtk, it&#39;s probably grabbing it from a third party location, not the vtk installed with paraview.<br>





<br>Also, try exporting LD_DEBUG=libs and then run paraview, that will print a lot of information to the terminal, it will tell you which libraries are being loaded.  See if any vtk libs are loaded from a location that is different than where paraview is installed.<br>





<br>Pat<br><br><br><br><div class="gmail_quote"><div><div>On Wed, Jan 30, 2013 at 10:20 AM, Maximilian Albert <span dir="ltr">&lt;<a href="mailto:maximilian.albert@gmail.com" target="_blank">maximilian.albert@gmail.com</a>&gt;</span> wrote:<br>





</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi,<br>
<br>
apologies for bumping my own message, but looking at the thread view<br>
[1] of the mailing list archives I just realised that strangely my<br>
email was filed under a completely unrelated thread (even though I<br>
hadn&#39;t replied to any messages) and maybe this is why it got lost in<br>
people&#39;s inboxes.<br>
<br>
So hopefully you won&#39;t mind me asking for help again - if anybody has<br>
any thoughts on the paraview/vtk segfault described below, this would<br>
be very much appreciated.<br>
<br>
Many thanks and kind regards,<br>
Max<br>
<br>
[1] <a href="http://www.paraview.org/pipermail/paraview/2013-January/thread.html" target="_blank">http://www.paraview.org/pipermail/paraview/2013-January/thread.html</a><br>
<br>
<br>
2013/1/21 Maximilian Albert &lt;<a href="mailto:maximilian.albert@gmail.com" target="_blank">maximilian.albert@gmail.com</a>&gt;:<br>
</div></div><div><div><div><div>&gt; Hi all,<br>
&gt;<br>
&gt; since this is my first post here, let me take the opportunity to thank<br>
&gt; all the developers for their hard work and and for an immensely useful<br>
&gt; piece of software! :)<br>
&gt;<br>
&gt; I&#39;m writing becasue I am having a problem with a very annoying<br>
&gt; segfault related to Paraview scripting and hope someone can help me.<br>
&gt; The following two lines when executed in a Python interpreter lead to<br>
&gt; a segfault:<br>
&gt;<br>
&gt;&gt;&gt;&gt; import vtk<br>
&gt;&gt;&gt;&gt; import paraview.servermanager<br>
&gt; Segmentation fault (core dumped)<br>
&gt;<br>
&gt; However, if I do the imports the other way around then it works fine.<br>
&gt;<br>
&gt;&gt;&gt;&gt; import paraview.servermanager<br>
&gt; paraview version 3.14.1, Date: 2012-02-17<br>
&gt;&gt;&gt;&gt; import vtk<br>
&gt;&gt;&gt;&gt;<br>
&gt;<br>
&gt; This looks like it should be a very common bug to hit, but I couldn&#39;t<br>
&gt; find anything on the web that looked similar. Does anybody have an<br>
&gt; idea what could be causing this and how to work around it? It is quite<br>
&gt; annoying because I&#39;m using the FEniCS package [1] to run simulations<br>
&gt; that I would like to visualize using Paraview, but FEniCS internally<br>
&gt; imports vtk, so now all my simulation scripts have stopped working and<br>
&gt; produce crashes. So any help would be much appreciated.<br>
&gt;<br>
&gt; For the record, I am using Ubuntu 12.04.1 LTS with the standard<br>
&gt; Paraview version 3.14.1 that is shipped with it, but I also tried it<br>
&gt; on another computer with version 3.98.0 from the PPA [2], and the<br>
&gt; segfault also happens there. The backtrace from the coredump is<br>
&gt; attached below in case it can be of any help.<br>
&gt;<br>
&gt; Many thanks and best regards,<br>
&gt; Max<br>
&gt;<br>
&gt; [1] <a href="http://fenicsproject.org/" target="_blank">http://fenicsproject.org/</a><br>
&gt; [2] <a href="http://ppa.launchpad.net/gladky-anton/paraview/ubuntu" target="_blank">http://ppa.launchpad.net/gladky-anton/paraview/ubuntu</a><br>
&gt;<br>
&gt;<br>
&gt; === Gdb session output with backtrace ===<br>
&gt;<br>
&gt; $ GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04<br>
&gt; Copyright (C) 2012 Free Software Foundation, Inc.<br>
&gt; License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>&gt;<br>
&gt; This is free software: you are free to change and redistribute it.<br>
&gt; There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;<br>
&gt; and &quot;show warranty&quot; for details.<br>
&gt; This GDB was configured as &quot;x86_64-linux-gnu&quot;.<br>
&gt; For bug reporting instructions, please see:<br>
&gt; &lt;<a href="http://bugs.launchpad.net/gdb-linaro/" target="_blank">http://bugs.launchpad.net/gdb-linaro/</a>&gt;...<br>
&gt; Reading symbols from /usr/bin/python...Reading symbols from<br>
&gt; /usr/lib/debug/usr/bin/python2.7...done.<br>
&gt; done.<br>
&gt; [New LWP 20514]<br>
&gt;<br>
&gt; warning: Can&#39;t read pathname for load map: Input/output error.<br>
&gt; [Thread debugging using libthread_db enabled]<br>
&gt; Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.<br>
&gt; Core was generated by `python&#39;.<br>
&gt; Program terminated with signal 11, Segmentation fault.<br>
&gt; #0  0x0000000000000000 in ?? ()<br>
&gt; (gdb) bt<br>
&gt; #0  0x0000000000000000 in ?? ()<br>
&gt; #1  0x00007f7ad64812ff in<br>
&gt; vtkTCPNetworkAccessManager::vtkTCPNetworkAccessManager() () from<br>
&gt; /usr/lib/paraview/libvtkPVClientServerCore.so<br>
&gt; #2  0x00007f7ad648136d in vtkTCPNetworkAccessManager::New() () from<br>
&gt; /usr/lib/paraview/libvtkPVClientServerCore.so<br>
&gt; #3  0x00007f7ad6475a92 in vtkProcessModule::vtkProcessModule() () from<br>
&gt; /usr/lib/paraview/libvtkPVClientServerCore.so<br>
&gt; #4  0x00007f7ad6475b6d in vtkProcessModule::New() () from<br>
&gt; /usr/lib/paraview/libvtkPVClientServerCore.so<br>
&gt; #5  0x00007f7ad6475e1b in<br>
&gt; vtkProcessModule::Initialize(vtkProcessModule::ProcessTypes, int&amp;,<br>
&gt; char**&amp;) () from /usr/lib/paraview/libvtkPVClientServerCore.so<br>
&gt; #6  0x00007f7acc4e987c in vtkInitializationHelper::Initialize(int,<br>
&gt; char**, int, vtkPVOptions*) () from<br>
&gt; /usr/lib/paraview/libvtkPVServerManager.so<br>
&gt; #7  0x00007f7acc4ea62e in vtkInitializationHelper::Initialize(char<br>
&gt; const*, int, vtkPVOptions*) () from<br>
&gt; /usr/lib/paraview/libvtkPVServerManager.so<br>
&gt; #8  0x00007f7acc8d8b45 in ?? () from<br>
&gt; /usr/lib/python2.7/dist-packages/vtkPVServerManagerPython.so<br>
&gt; #9  0x0000000000497ea4 in PyEval_EvalFrameEx ()<br>
&gt; #10 0x000000000049f1c0 in PyEval_EvalCodeEx ()<br>
&gt; #11 0x00000000004a7f18 in PyImport_ExecCodeModuleEx ()<br>
&gt; #12 0x000000000053cde1 in load_source_module.39052 ()<br>
&gt; #13 0x000000000053d7db in import_submodule.39106 ()<br>
&gt; #14 0x00000000004fc1a3 in load_next.39111 ()<br>
&gt; #15 0x000000000053e266 in import_module_level.isra.3.39132 ()<br>
&gt; #16 0x00000000004c2e6b in builtin___import__.32787 ()<br>
&gt; #17 0x00000000004e9f36 in PyObject_Call ()<br>
&gt; #18 0x00000000004ea396 in PyEval_CallObjectWithKeywords ()<br>
&gt; #19 0x000000000049a4ed in PyEval_EvalFrameEx ()<br>
&gt; #20 0x000000000049f1c0 in PyEval_EvalCodeEx ()<br>
&gt; #21 0x00000000004a9d0f in PyRun_InteractiveOneFlags ()<br>
&gt; #22 0x00000000004aa075 in PyRun_InteractiveLoopFlags ()<br>
&gt; #23 0x00000000004aa328 in PyRun_AnyFileExFlags ()<br>
&gt; #24 0x00000000004aa8bd in Py_Main ()<br>
&gt; #25 0x00007f7af885f76d in __libc_start_main () from<br>
&gt; /lib/x86_64-linux-gnu/libc.so.6<br>
&gt; #26 0x000000000041b9b1 in _start ()<br></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>