$ /var/run/strace -p 5564 -e shmat
/var/run/strace: Process 5564 attached
/var/run/strace: [ Process PID=5564 runs in 32 bit mode. ]
shmat(0, 0x1fc15000, 0)                 = 0x1fc15000
shmat(1, 0x1fc15000, 0)                 = -1 EINVAL (Invalid argument)
shmat(3, 0x1fc15000, 0)                 = -1 EINVAL (Invalid argument)

Please check the documentation which can be read in the output from
running the shell command "man 2 shmat".  Each of the three arguments
to shmat() is an input value that is specified by your program.
So in this case, your program has specified the same value 0x1fc15000
to three separate calls of shmat(), which requests that the shared
memory segments 0, 1, and 3 be attached sequentially at the same
address in the address space of the process, replacing the previous
segment.  The documentation does not say anything about such a case.
Perhaps shmdt() must be called between successive shmat() which
specify the same address?  And are the access permissions the same?

Anyway, the address must be a multiple of SHMLBA, which might well
be larger than the PAGE_SIZE.  The value 2*PAGE_SIZE (or 4*PAGE_SIZE)
might be a common requirement, or perhaps SHMLBA could be much larger.-
Please show the output from running the shell command "uname -a"
which might provide some hints.  In particular, MIPS hardware often
is troublesome.  In another process you specify the address 0x1be88000
which is a multiple of 32KB, which is suspiciously larger than 4KB.

Also, the "-e shmat" shows occurrences of only that one system call.
It might be better to use "-e trace=memory", or "-e trace=shmat,shmdt,
shmctl,shmget" to see more information.


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to