Re: gdk_draw_segments crash the application when called with more than 32767 segments.



On Tue, Feb 17, 2004 at 09:22:47AM +0100, Matthias Clasen wrote:
> > On Mon, Feb 16, 2004 at 07:19:18PM -0500, Owen Taylor wrote:
> > > On Mon, 2004-02-16 at 19:07, James Willcox wrote:
> > > > On Mon, 2004-02-02 at 14:11, David Odin wrote:
> > > > >   Hi,
> > > > > 
> > > > > As bug #122026 states, gdk_draw_segments crashes the application
> > when
> > > > > called with more than 32767, due to a X protocol limitation.
> > > > > 
> > > > > Imho, an application shouldn't have to care about this.
> > > > > The report in bugzilla fixes this at gdk level.
> > > > > 
> > > > >   Can I commit?
> > > > 
> > > > Was this patch approved?  You apparently commited it today, and it
> > broke
> > > > the build.
> > > 
> > > Indeed, the patch wasn't approved yet, leaving aside issues of build
> > > breakage, there is one obvious problem with the patch, and two
> > > issues that needed to be researched (questions I don't know the
> > > answers to offhand)
> > >
> >   I hadn't any positive or negative response in more than two weeks.  Now
> > this bug seems to have more interest.  I admit that this isn't a good
> > method, but at least, now I am more confident this will be fixed soon.
> > 
> 
> A little impatient, aren't you ? Two weeks is nothing compared to the age of
> some of our bugs.
>
  Yes I'm impatient. I've already apologized for this. Two weeks is
indeed nothing for a bug's lifetime in bugzilla.  On the other hand two
weeks is often more than enough to answer a mail.

> > >  - The patch patches the wrong file, since it is dealing with
> > >    X11-specific limitations, it should be patching X specific files
> > > 
> >   Well spotted. See my new patch in bugzilla. But are you really sure
> > this limitation isn't there in the others gdk backend?
> 
> Each backend has to deal with its own limitations.
> 
  I can understand this.  But if the limitation is the same for every
backend, shouldn't we put the limit into gdk/gdkdraw.c, then? (Just
asking).
>
> > >  - What's the interaction of XDrawSegments with, say, a XOR mode
> > >    if the segments overlap? 
> > > 
> >   Do you really think this is a problem with that much segments anyway?
> > Beside, apart from recoding the whole thing, I don't see how to solve
> > this issue. And really, I don't think this will worth it.
> > 
> > By the way, the man page says: "If lines intersect, the intersecting
> > pixels are drawn multiple times.", so the XOR problem looks like a
> > non-issue to me;
> >        
> > >
> > >  - What's the interaction of this with maximum request sizes? Is 
> > >    32767 really the right figure here or just an approximation 
> > >    that works on your system?
> > > 
> >   The error message I got told me this should be a 16 bits value...
> 
> Having only 16 bits to store the length is one thing (which gives you an
> upper bound of
> 32767), but the X protocol also has a maximal request size, which can vary
> from server to server. So even if the X protocol may allow an XDrawSegments
> request with 32767 segments, it may be too large for the server you're talking
> with.
> 
 An old documentation I have here, about X11R4, says that we should use
the value returned by XMaxRequestSize minus 3 divided by 2. This really
looks like black magic to me, but this wouldn't be hard to implement.

Can we move this discussion to bugzilla, so the comments won't be
forgotten?

    Regards,

          DindinX


-- 
david dindinx org
The best way to hold a man is in your arms.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]