[vtkusers] python + vtkTkRenderWidget + threading == X restart

Jan Vittrup Hansen Jan.Vittrup at Person.dk
Fri May 18 11:14:43 EDT 2001


Thank you for your detailed responce :o)

I just tested on a SGI Onyx and it actually crashes with an error
message:

> python examples/water_test.py
X Error of failed request:  BadAccess (attempt to access private
resource denied)
  Major opcode of failed request:  146 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  0
  Current serial number in output stream:  159


This X_GLXMakeCurrent actually coincides with another problem when
having more than one window. In that case vtk often crashes X during
RenderWindow.MakeCurrent(). 

Still, I can't figure out whether this is intrinsic to opengl, or a vtk
problem :o(

  Regards, 

   Jan... Prabhu Ramachandran wrote:
> 
> hi,
> 
> >>>>> "JVH" == Jan Vittrup Hansen <Jan.Vittrup at Person.dk> writes:
> 
>     JVH> Hi All, I seem to be unable to do threaded interaction in
>     JVH> python. Therefor a small test example has been deviced, which
>     JVH> on my machine (redhat71 + matrox g400 + rh7 vtk rpms) crashes
>     JVH> X.  Are you daring enough to try it ;o) Seriously, I would be
>     JVH> greatfull if anyone can test this using other graphics
>     JVH> drivers, or tell me what I'm doing wrong :o)
> 
> Well I tried this on the interpreter
> 
> >>> from vtkpython import *
> >>> from Tkinter import *
> >>> from vtkRenderWidget import *
> >>> import time, thread
> >>> source = vtkSphereSource()
> >>> mapper = vtkPolyDataMapper()
> >>> mapper.SetInput(source.GetOutput())
> >>> actor = vtkActor()
> >>> actor.SetMapper(mapper)
> >>> root = Tk()
> >>> pane = vtkTkRenderWidget(root,width=300,height=300)
> >>> ren = vtkRenderer()
> >>> renWin = pane.GetRenderWindow()
> >>> renWin.AddRenderer(ren)
> >>> ren.AddActor(actor)
> >>> # pack the pane into the tk root
> ... pane.pack (fill="both", expand=1)
> >>> print "test"
> 
> and everything works fine upto this point (I can even interact with
> the spehere etc.).  However, the instant I add the following it
> behaves strangely.
> 
> >>> thread.start_new_thread(root.mainloop, ())
> 
> It works for a while and then hangs.  I have to ^C at the interpreter
> to do anything.
> 
> I also checked to see if Tkinter was the problem, it isnt.
> 
> >>> def f (event=None):
> ...   print "Inside f()"
> ...
> >>> from Tkinter import *
> >>> root = Tk ()
> >>> b = Button (root, text="Test", command=f)
> >>> import thread
> >>> thread.start_new_thread (root.mainloop,  ())
> >>>
> 
> And everything runs fine.
> 
> BTW, I am using Debian GNU/Linux 2.2 with the VTK nightlies + Python
> 1.5.2 + Tcl/Tk 8.0.  Xfree86 4.0.2 with an nVidia TNT2 card and the
> nVidia drivers.
> 
> prabhu
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list