[GRASS-dev] debugging nviz with TclTk 8.5 aqua

Michael Barton michael.barton at asu.edu
Tue Jul 22 21:35:49 EDT 2008


On Jul 22, 2008, at 6:29 PM, Glynn Clements wrote:

>
> Michael Barton wrote:
>
>>>> (gdb) print ((MacDrawable *) (window))
>>>> No symbol "MacDrawable" in current context.
>>>
>>> Hmm; does this work:
>>>
>>> 	print ((struct TkWindowPrivate *) (window))
>>> 	print ((struct TkWindowPrivate *) (window))->toplevel
>>> 	print ((struct TkWindowPrivate *) (window))->toplevel->grafPtr
>>> ?
>>>
>>> Failing that, just:
>>>
>>> 	print window
>>>
>>> might provide a clue.
>>>
>>> OTOH, I'm not sure if any of this will actually help in the end. The
>>> conclusion may well just be "Togl doesn't work with 8.5". I can't  
>>> see
>>> any references to 8.5 on the Togl site (it isn't a particularly  
>>> active
>>> project).
>>
>> This actually produced some results.
>
>> (gdb) print ((struct TkWindowPrivate *) (window))
>> $1 = (struct TkWindowPrivate *) 0x1d7c648
>> (gdb) print ((struct TkWindowPrivate *) (window))->toplevel
>> $2 = (struct TkWindowPrivate *) 0x28
>
> Ouch.
>
> Do you have more than one version of Tcl/Tk on your system? One
> possibility is that the tkMacOSXInt.h header which Togl is using
> doesn't match the library.
>
> Another possibility is that the structure packing could be affected by
> compiler switches, so if Togl isn't compiled with the same switches as
> the Tk library, it won't be accessing the fields correctly.
>
> Can you try:
>
> 	print *((struct TkWindowPrivate *) (window))
>
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000002c
0x0001702d in Togl_CreateWindow (tkwin=0x5cf0608, parent=97384328,  
instanceData=0x757dc0) at togl.c:2338
2338	        if (!aglSetDrawable(togl->aglCtx,
(gdb) print *((struct TkWindowPrivate *) (window))
$1 = {
   winPtr = 0x5cf0608,
   grafPtr = 0x0,
   context = 0x6c63542f,
   rootControl = 0x0,
   xOff = 0,
   yOff = 7337416,
   size = {
     width = 1.02819154e-38,
     height = 0
   },
   visRgn = 0x936b48,
   aboveVisRgn = 0x0,
   drawRect = {
     origin = {
       x = 6.97764217e+22,
       y = 1.8089652e+25
     },
     size = {
       width = 1.41764467e+22,
       height = 1.63008877e-19
     }
   },
   referenceCount = -271777041,
   toplevel = 0x28,
   flags = 97452040
}
(gdb)

Mac OS X 10.5 comes with TclTk aqua 8.4 and 8.5. But I also have to  
install an x11 version that I compile (in /usr/local/tcltk) in order  
to compile and run GRASS with the standard x11 tcltk.

Michael




More information about the grass-dev mailing list