[Xcb] problem with the use of the shm extension

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


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


More information about the Xcb mailing list