Index: [thread] [date] [subject] [author]
  From: cd_smith@ou.edu
  To  : ggi-develop@eskimo.com
  Date: Mon, 26 Jul 1999 12:45:48 -0500 (CDT)

Freeze in _ggi_clip2d()

Hey,

I'll track this down more in a sec, but here's a basic description of
what's happening.  I have a very simple 3D wireframe program using GGI.
My draw routine just walks through all the lines, clips them in 3D to
whatever part is in front of z = 0.1 (just to be safe), and then projects
and draws the lines.  It does this blindly, so I am calling ggiDrawLine
with some values that are pretty far off the screen occasionally, and
trusting the 2D clipping in GGI to get it right.

Occasionally, the program freezes.  Whenever this happens, I can attach a
gdb to the process and find out that the freeze happened in _ggi_clip2d().
I've attached a typescript of a gdb session which shows the parameters
used in the call to _ggi_clip2d().  I haven't actually looked at the
function itself yet to find out what's going wrong.  That's coming next.

Script started on Mon Jul 26 11:45:11 1999
$ gdb space
GNU gdb 4.17.19981224.m68k.objc.threads.hwwp.fpu.gnat
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) attach 23681
Attaching to program `/home/cdsmith/workspace/projects/space/space', Pid 23681
Reading symbols from /usr/local/lib/libggi.so.2...done.
Reading symbols from /usr/local/lib/libgii.so.0...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /usr/local/lib/libgg.so.0...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /usr/lib/libpthread.so...done.
Linux thread target has modified Unknown signal handling
Reading symbols from /usr/local/lib/ggi/display/X.so...done.
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
Reading symbols from /usr/local/lib/ggi/display/mansync.so...done.
Reading symbols from /usr/local/lib/ggi/input/xwin.so...done.
Reading symbols from /usr/local/lib/ggi/display/memory.so...done.
Reading symbols from /usr/local/lib/ggi/input/null.so...done.
Reading symbols from /usr/local/lib/ggi/default/stubs.so...done.
Reading symbols from /usr/local/lib/ggi/default/color.so...done.
Reading symbols from /usr/local/lib/ggi/default/linear_16.so...done.
_ggi_clip2d (vis=0x80528a8, _x0=0xbffffa60, _y0=0xbffffa64, _x1=0xbffffa68, 
    _y1=0xbffffa6c, clip_first=0xbffffa70, clip_last=0xbffffa74)
    at ../common/../common/clip.c:215
215			if ((first | last) == 0) {
(gdb) bt
#0  _ggi_clip2d (vis=0x80528a8, _x0=0xbffffa60, _y0=0xbffffa64, 
    _x1=0xbffffa68, _y1=0xbffffa6c, clip_first=0xbffffa70, 
    clip_last=0xbffffa74) at ../common/../common/clip.c:215
#1  0x402b673f in GGI_lin16_drawline (vis=0x80528a8, orig_x1=30432, 
    orig_y1=30158, orig_x2=-2085, orig_y2=-10250) at ../common/linear-line.c:58
#2  0x40021831 in ggiDrawLine (vis=0x80528a8, x=30432, y=30158, xe=-2085, 
    ye=-10250) at stubs.c:182
#3  0x8048fc4 in draw_screen () at space.c:169
#4  0x8049785 in main_loop () at space.c:380
#5  0x80498ff in main (argc=1, argv=0xbffffc94) at space.c:421
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Linux thread target has restored Unknown signal handling
Detaching from program: /home/cdsmith/workspace/projects/space/space Thread 23681
$ 
Script done on Mon Jul 26 11:46:44 1999


Chris Smith <cd_smith@ou.edu>

Index: [thread] [date] [subject] [author]