X Windows Shm extensions

apologies if this is off topic but sdl uses them i figured there was a knowledge base here i
could ask.

i’m trying to use the MIT-Shm extensions for X - my application seems to initialize everything
properly but when i attempt to write something to my window with XShmPutImage i get a fatal X
error (BadAccess) and my application terminates.

anyone got any suggestions or pointers to information pls.