> I am using RHEL6.2 OS.
> 
> 'uname -a' output is
> Linux mercury05 2.6.32-220.17.1.el6.x86_64 #1 SMP Thu Apr 26 13:37:13 EDT 
> 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
> using valgrind version 3.8.0 also shmat is failing with errno 22.

Thank you for that information.  Is the process running in "native" 64-bit mode,
or is this a 32-bit [only] process whose environment is being "emulated"
by the x86_64 system?

Now, please try to construct a small test case which fails in the same way:
The test app calls shmat() and works without valgrind, but gets EINVAL
when run under valgrind-3.8.0.  Post the actual code to this mailing list;
the code should be no more than a few dozen lines.

Here are some situations which might affect the results:

  How many shared memory segments are attached by the app,
  and how many other shared memory segments are active
  at the same time in the whole system?

  What is the mix of access permissions (ReadOnly, ReadWrite, ...)?

  Were the shared memory segments created by the same process,
  or did the segments exist already before the process began?

  Is each shared memory segment being attached only once
  by any particular process, or are there multiple mappings?

  Is there any case which succeeds when (0!=shmaddr) ?
  Attach using shmat(shmid, 0, 0); Remember the address;
  Detach the segment; try to re-attach using shmat(shmid, old_addr, 0)
  where old_addr is the address which was returned for the first
  (successful) attach.

-- 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to