home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / windows / x / 16548 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.5 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!dtix!mimsy!prometheus!media!arthur
  2. From: arthur@media.uucp (Art Poley)
  3. Newsgroups: comp.windows.x
  4. Subject: X11/R4 Shared Memory Extensions -- Server Error
  5. Message-ID: <1992Sep10.165540.18373@media.uucp>
  6. Date: 10 Sep 92 16:55:40 GMT
  7. Organization: Media Cybernetics, Inc.
  8. Lines: 41
  9.  
  10. I've recently encountered an X Error while using the Shared Memory extensions.
  11. The message is as follows:
  12.  
  13.  
  14. X Error of failed request: BadAccess (attempt to access private resource denied)
  15.  Major opcode of failed request: 129 (MIT-SHM)
  16.  Minor opcode of failed request: 1 (X_ShmAttach)
  17.  Serial Number of failed request: 12615
  18.  Current serial number in output stream: 12642
  19.  
  20.  
  21. Briefly, the approach is as follows:
  22.  
  23.         image = XShmCreateImage()
  24.  
  25.         shminfo->shmid = shmget(IPC_PRIVATE, image->bytes_per_line * image->height, IPC_CREAT|0777);
  26.         if(shminfo->shmid > 0)
  27.         {
  28.             shminfo->shmaddr = image->data = shmat(shminfo->shmid, 0, 0);
  29.             if(shminfo->shmaddr != ((char *)-1)) 
  30.             {
  31.                 shminfo->readOnly = False;
  32.                 XShmAttach(display, shminfo);
  33.             }
  34.         }
  35.  
  36.  
  37. The code above would not do a XShmAttach if creation or attachment to the
  38. segment fails.  Therefore, why is the XShmAttach causing a server error
  39. every so often?  If anyone has encountered this before I'd appreciate
  40. your feedback.
  41.  
  42.  
  43.  
  44. Thanks in advance,
  45.  
  46. Art Poley
  47. -- 
  48. --------------------------------------------------------------------------
  49. Art Poley - S & S Inficon               Phone: (301)975-0728 (9655 FAX)
  50. Internet: arthur%media@uunet.uu.net     UUCP: {uunet,hqda-ai}!media!arthur
  51.