bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug about share Memory


From: zhangkeqi84
Subject: bug about share Memory
Date: Tue, 13 Nov 2007 10:54:41 +0800 (CST)

 hello:
       This is a mail from china.
       Using your System() for a project, I find a bug about the share memory.
       The share memory in your system working like this: 
       the A,B process: 
       A create the share memory using the struct temp:
       strcut temp
       {
              char *p;
              char ch;
       };
        p =  &ch;
        ch = 'a';
         
       the  share memory will be like this:
       addr          data content
       ....
       0x0F00AB00    (p)0x0F00AB04
       0x0F00AB04    (ch)'a'
       ....
       if process B get the same Share memory with shmat(shmid,0,0);
         
       like this

       addr             data content
       0x0D002400       (p)0x0F00AB04
       0x0D002404       (ch) 'a'

       Using the p in process B,  maybe I will get a “segmentation fault”

       if process B get the same Share memory with shmat(shmid,addr,SHM_REMAP); 
//addr is the address of share  memory of  A;  
      sometimes i will get the segmentation fault in the sentence(shmat) and 
process dump; 


       It's very nice that if you can solve this problem asap!


                                                                     YOURS
                                                                                
   keqi zhang
                
                                                                                
      2007 11 13
       

                           

       

       

 
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]