[Xcb] problem with the use of the shm extension

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Sat Oct 1 00:44:44 PDT 2005


I've seen that there's XCBShmInit in shm.h, but I don't know how to use
it. Its call does not solve the problem. Should I do sommething with its
reply ?

Vincent

On Sat, 1 Oct 2005, Vincent Torri wrote:

>
> Hello,
>
> I have a problem with te shm extension.
>
> the code :
>
> struct _Xcb_Output_Buffer
> {
>    XCBConnection     *connection;
>    XCBImage          *image;
>    XCBShmSegmentInfo *shm_info;
>    void              *data;
> };
>
>         Xcb_Output_Buffer *xcbob;
>
> 	xcbob->shm_info = malloc(sizeof(XCBShmSegmentInfo));
> 	if (xcbob->shm_info)
> 	  {
> 	     xcbob->shm_info->shmseg = XCBShmSEGNew(c);
> 	     xcbob->image = XCBImageSHMCreate(c, depth, ZPixmap, NULL, w,
> h);
> 	     if (xcbob->image)
> 	       {
> 		  xcbob->shm_info->shmid = shmget(IPC_PRIVATE,
>
> xcbob->image->bytes_per_line *
> 						  xcbob->image->height,
> 						  IPC_CREAT | 0777);
> 		  if (xcbob->shm_info->shmid >= 0)
> 		    {
> 		       xcbob->shm_info->shmaddr = xcbob->image->data =
> 			 shmat(xcbob->shm_info->shmid, 0, 0);
> 		       if (xcbob->shm_info->shmaddr != NULL)
> 			 {
> 			   /*
> 			    * FIXME: no error mechanism
> 			    */
> 			 }
> 		       shmdt(xcbob->shm_info->shmaddr);
> 		       shmctl(xcbob->shm_info->shmid, IPC_RMID, 0);
> 		    }
> 		  if (xcbob->image) XCBImageSHMDestroy(xcbob->image);
> 		  xcbob->image = NULL;
> 	       }
> 	     if (xcbob->shm_info) free(xcbob->shm_info);
> 	     xcbob->shm_info = NULL;
> 	  }
>
> I get this error message :
>
> ecore_evas_test: xcb_out.c:109: XCBSendRequest: Assertion `extension &&
> extension->present' failed.
>
> So I suppose that I forget to initialize the shm extension, or something
> like that. Does someone see what I have forgotten ?
>
> thank you
>
> Vincent
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>


More information about the Xcb mailing list