Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!stroyan From: stroyan@hpfcso.HP.COM (Mike Stroyan) Newsgroups: comp.sys.hp Subject: Re: bug? -- XDrawLine can freeze HP-UX 6.5 X server Message-ID: <7370085@hpfcso.HP.COM> Date: 18 Feb 90 22:23:35 GMT References: <17056@boulder.Colorado.EDU> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 27 > I'm writing a program that does graphics in an X window, > and at a certain point, during an XDrawLine call, my > display freezes and I have no choice except to kill the > X server. This is under HP-UX 6.5 -- we don't have 7.0 > here yet; and it's on an HP 370. > The arguments to XDrawLine (corresponding to > XDrawLine(display, d, gc, x1, y1, x2, y2)) are x1 = 19642, > y1 = 25985, x2 = -9529, y2 = -20184. These numbers are very > big, of course, but I don't want to fool with them, because > with clipping it is possible that part of the line will pass > through my window. ... > Is this a server bug? Can anyone from HP comment? > -- Bill Skaggs Yep, it's a server bug. The Bresenham vector generator is overflowing when computing the error term for very long lines. The magnitude of the error term exceeds 2^31, and sign errors can result in an infinite loop. The problem was found after 7.0 went out. It will be fixed in the next release. For now you can either- 1) Clip your lines to the window boundaries. 2) Use width 1 wide lines instead of width 0 lines. (This will be slower.) 3) Talk to your HP service representative about getting a patched X server. Mike Stroyan, stroyan@hpfcla.hp.com