|
From: smiley g. <smi...@ya...> - 2004-04-07 18:28:31
Attachments:
server.c
|
Hello, I have a program that uses shared memory. When the program requests for a segment it goes through fine. when i want it to be aligned at a particular address, there seems to be some problem with valgrind. i.e. shmat(key, <addr>, <perms>) problem occurs when addr is not null. Have attached a sample program. Thanks in advance, smile __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Tom H. <th...@cy...> - 2004-04-07 18:36:33
|
In message <200...@we...>
smiley glitter <smi...@ya...> wrote:
> I have a program that uses shared memory. When the
> program requests for a segment it goes through fine.
> when i want it to be aligned at a particular address,
> there seems to be some problem with valgrind.
>
> i.e.
>
> shmat(key, <addr>, <perms>)
>
> problem occurs when addr is not null. Have attached a
> sample program.
When you say "there seems to be some problem" what exactly does
that mean? What happens that is different from normal?
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Tom H. <th...@cy...> - 2004-04-07 18:47:58
|
In message <2b6...@lo...>
Tom Hughes <th...@cy...> wrote:
> In message <200...@we...>
> smiley glitter <smi...@ya...> wrote:
>
> > I have a program that uses shared memory. When the
> > program requests for a segment it goes through fine.
> > when i want it to be aligned at a particular address,
> > there seems to be some problem with valgrind.
> >
> > i.e.
> >
> > shmat(key, <addr>, <perms>)
> >
> > problem occurs when addr is not null. Have attached a
> > sample program.
>
> When you say "there seems to be some problem" what exactly does
> that mean? What happens that is different from normal?
OK. I've tried your example now, and I see the problem.
Your problem is that valgrind has to reserve part of the address
space for it's own use, and the address you are trying to use is
in that reserved space when you use the memcheck skin, so valgrind
prevents you using it.
If you use addrcheck then it will work, because that skin doesn't
need as much shadow memory, so there is more address space left
for the client program.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|