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

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.

>  - 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?

>  - 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...

By the way, my (new) patch doesn't handle one thing: the
gdk_x11_draw_segments() allocate a huge amount of memory to duplicate
all the segments.  This could be fixed be moving the assigments into the
loop.  Feel free to change this, too.

     Regards, and apologizes.


david dindinx org
main(i){int j,s,d[1001];for(i=1e3;i;)d[i--]=1;for(printf("e>2.");++i<429;

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