Re: [AD] [XWIN] SHM bug.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On March 10, 2002 10:32 am, you wrote:
> > With the latest Allegro (just did a cvs upd), using any function except
> > blit to draw directly to the screen causes a 'BadAccess' error from X.
>
> Here are the results of my investigations: the program
>
[snip code]
>
> never fails, but consistently (90% of cases) gives
>
> X Error of failed request:  BadAccess (attempt to access private resource
> denied)
>   Major opcode of failed request:  143 (MIT-SHM)
>   Minor opcode of failed request:  1 (X_ShmAttach)
>   Serial number of failed request:  33
>   Current serial number in output stream:  52


That error always kills the app on my machine.


> Now, considering the function _xwin_destroy_screen() from src/x/xwin.c, if
> I put a 'usleep(1000000);' this way
>
> void _xwin_destroy_screen(void)
> {
>    usleep(1000000);
>    XLOCK();
>    _xwin_private_destroy_screen();
>    XUNLOCK();
> }
>
> the problem goes away. But if I put it that way
>
> void _xwin_destroy_screen(void)
> {
>    XLOCK();
>    usleep(1000000);
>    _xwin_private_destroy_screen();
>    XUNLOCK();
> }
>
> the problem is back.
>
>
> I don't know very well how X and threads interact, so I can't say if it's a
> synchronization problem between two threads that are racing for locking the
> X server or simply a problem that originates in XLOCK() itself.

except my major problem is whenever Im just writing to the screen. If I try 
anything but 'blit' (ie: line, clear, textout, etc...) I get that 'BadAccess' 
error. Although the problem you pointed out does show it's head now and then.

So all my new/current apps are double buffering. (btw: my problem appears 
with any driver that uses shm, ie: all of the X drivers)

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/