From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Nov 10 2003 - 11:01:04 CST

Lars,
  Interesting, looks like some sort of Evil occured inside of Python/VTK
once it started up. The only change I made to VMD was to add a bit of
state tracking code and force it to call glXMakeCurrent() right before
it executes any OpenGL commands. I'm wondering if VTK lacks its own
matching calls and is seg faulting because it is then accessing VMD's
OpenGL state (textures, vertex arrays, various things that could annihilate
and unsuspecting OpenGL program...)

Do you know if this Python VTK module has been made to get along with any
other OpenGL code besides VMD? Its possible that BOTH VMD and VTK would
require modifications to get them to work together in concert. While I can
easily make VMD more mindful of its own OpenGL state, I'm not sure what to
suggest if the crash is occuring inside of VTK or Python.

In order to track the lost console messages you mentioned, try doing this
when you run VMD next time:
  source /usr/local/bin/vmd (starts up as usual)
  quit (quit that VMD, just needed the env settings
                             for the next run)
  /usr/local/lib/vmd/vmd_LINUX

Once you start it manually as shown, rather than starting a separate xterm
for the VMD console, you'll get all of the VMD output in the window you
run that command from, so that when you re-test VTK and the crash occurs,
you'll be able to see what console messages were printed. Give that a try
and let me know what happens.

Thanks,
  John Stone
  vmd_at_ks.uiuc.edu

On Mon, Nov 10, 2003 at 11:12:25AM +0100, Lars Bruno Hansen wrote:
> John Stone wrote:
>
> >Lars,
> > I hacked the VMD source quickly to force all redraws to reset the
> >active OpenGL context. This may (or may not) affect the behavior you've
> >seen in your tests of the VTK module inside of VMD. Have a shot with the
> >binary I've posted here, no guarantees, but it might behave differently:
> > ftp://ftp.ks.uiuc.edu/pub/mdscope/vmd/alpha/vtktest/
> >
> >Give that a try and let me know what happens. You can drop that binary
> >in place of the one that comes in the Linux beta test version here:
> > ftp://ftp.ks.uiuc.edu/pub/mdscope/vmd/alpha/
> >
> >
> Dear John
>
> Thanks,
> I tried the new executable,
> vmd now core dumps then starting VTK in the python window,
> This seems to be reproducible. Something is written by VMD,
> however the window is removed before I can read it.
> I tried running gdb on the core:
>
> gdb vmd_LINUX core.28676
>
> #0 0xffffe002 in ?? ()
> (gdb) where
> #0 0xffffe002 in ?? ()
> #1 0x42028b93 in abort () from /lib/tls/libc.so.6
> #2 0x082823ce in Py_FatalError (msg=0x844dc40 "PyEval_RestoreThread: NULL
> tstate") at ../Python/pythonrun.c:1276
> #3 0x08268150 in PyEval_RestoreThread (tstate=0x0) at ../Python/ceval.c:336
> #4 0x082988e3 in PythonCmd (clientData=0x97a6c70, interp=0x9766ed0,
> argc=20, argv=0x8efe2a0)
> at ../Modules/_tkinter.c:1271
> #5 0x083354d9 in TclInvokeStringCommand ()
> #6 0x083363e2 in TclEvalObjvInternal ()
> #7 0x08357266 in TclExecuteByteCode ()
> #8 0x08356553 in Tcl_ExprObj ()
> #9 0x08337a6b in Tcl_ExprBooleanObj ()
> #10 0x0833e432 in Tcl_IfObjCmd ()
> #11 0x083363e2 in TclEvalObjvInternal ()
> #12 0x08336dd4 in Tcl_EvalEx ()
> #13 0x083371b1 in Tcl_Eval ()
> #14 0x083386ee in Tcl_GlobalEval ()
> #15 0x0830759a in Tk_BindEvent ()
> #16 0x0830c58f in TkBindEventProc ()
> #17 0x08312d2e in Tk_HandleEvent ()
> #18 0x083131dc in WindowEventProc ()
> #19 0x0837837a in Tcl_ServiceEvent ()
> #20 0x083786b9 in Tcl_DoOneEvent ()
> #21 0x0817b7fa in TclTextInterp::doTkUpdate ()
> #22 0x0816fb40 in main ()
> #23 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
>
>
> My openGL setup is as follows:
> Info) OpenGL renderer: Mesa DRI Intel(R) 865G 20021115
> Info) Features: STENCIL RN MTX
> Info) Textures: 2-D (512x512), 3-D (128x128x1), Multitexture (2)
>
>
> Please let me know if I can provide more information.
>
> with best regards
> Lars
>
> --
> Lars Bruno Hansen,
> CAMP, Dept. of Physics, Building 307, DTU, DK-2800 Lyngby, Denmark
> Phone: +45 45 25 32 16 Fax: +45 45 93 23 99
> E-mail: lhansen_at_fysik.dtu.dk
>
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078