winex11.drv: try work around a crash
Marcus Meissner
meissner at suse.de
Thu Jan 24 03:51:43 CST 2008
On Thu, Jan 24, 2008 at 10:44:43AM +0100, Marcus Meissner wrote:
> On Thu, Jan 24, 2008 at 09:00:32AM +0000, Louis. Lenders wrote:
> >
> > Hi, basically this is a resend of a patch i sent very long time ago ( http://www.winehq.org/pipermail/wine-patches/2007-April/037733.html )
> >
> > It's a fix for bug http://bugs.winehq.org/show_bug.cgi?id=7380#c29
> >
> > As explained in comment http://bugs.winehq.org/show_bug.cgi?id=7380#c29
> > the cause of these crashes is some buggy mfc-function
> > , and as windows is able to work around this, wine should do the same.
> >
> > I've put the exception handler only around X11DRV_DIB_SetImageBits_24 , as that's where all the applications crash; if we want to mimic windows behaviour it should be put around all cases i guess, but i'm not sure we want to that and maybe hide other bugs.
> >
> > If this patch is rejected could you please comment why, to help fix the bug in a better way
>
> Remembering a different bug with the same issue I think you should not wrap
> DIB_SetImageBits_24 but just check descr->bits in X11DRV_DIB_SetImageBits()
>
> Something along the lines of:
>
> unsigned long off;
> unsigned char volatile x;
>
> __TRY {
> for (off=0;off<descr->sizeImage;off+=PAGE_SIZE) {
> x += ((unsigned char*)descr->bits)[off]
> }
> } ...
Or just IsBadReadPtr(descr->bits,descr->sizeImage) of course. :/
(Although Alexandre likely has different opinions ;)
Ciao, Marcus
More information about the wine-devel
mailing list