Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
shmat() system calls improved in the strace tool
Previously, when debugging with the strace tool, running a shmat() system call returned a '?' value instead of reporting the attached shared memory segment address. strace has been improved so that shmat() system calls now return the correct address of the attached shared memory segment.
Description of problem:
The strace delivered in the RHEL 6.4, 6.3 (and possibly earlier) releases does not report the return value for the shmat. It incorrectly returns a "?" (question mark) instead of the address that the segment was attached to.
Version-Release number of selected component (if applicable):
# strace -V
strace -- version 4.5.19
# uname -a
Linux perf82.lab.bos.redhat.com 2.6.32-330.el6.x86_64 #1 SMP Thu Oct 11 15:37:45 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
How reproducible:
The simple reproducer .c file and command is listed below
Steps to Reproduce:
Compile the following .c file and run it with strace. The steps are listed below:
# cat shm_example.c
#include <stdio.h>
#include <sys/shm.h>
#include <sys/stat.h>
int main ()
{
int seg_id;
char* shm_ptr;
int segment_size;
const int seg_siz = 1024*1024;
seg_id = shmget (IPC_PRIVATE, seg_siz , IPC_CREAT | S_IRUSR | S_IWUSR );
shm_ptr = (char*) shmat (seg_id, 0, 0);
shmdt (shm_ptr);
shmctl (seg_id, IPC_RMID, 0);
return 0;
}
# gcc shm_example.c -o ./a.out
# strace -etrace=shmat ./a.out
shmat(294912, 0, 0) = ?
Actual results:
# strace -etrace=shmat ./a.out
shmat(294912, 0, 0) = ?
Expected results:
# strace -etrace=shmat ./a.out
shmat(294912, 0, 0) = <the_attached_address>
Additional info:
I've confirmed that this is fixed in the upstream strace 4.7 version. It would be really useful to make this fix available in the RHEL 6.x release stream.
Comment 5RHEL Program Management
2013-10-14 00:15:40 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Product Management, Engineering, and have determined that this bug should be described in the RHEL 6.7 Release Notes. Please update the Doc Text field with a summary feature description by April 22.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-1308.html
Description of problem: The strace delivered in the RHEL 6.4, 6.3 (and possibly earlier) releases does not report the return value for the shmat. It incorrectly returns a "?" (question mark) instead of the address that the segment was attached to. Version-Release number of selected component (if applicable): # strace -V strace -- version 4.5.19 # uname -a Linux perf82.lab.bos.redhat.com 2.6.32-330.el6.x86_64 #1 SMP Thu Oct 11 15:37:45 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux How reproducible: The simple reproducer .c file and command is listed below Steps to Reproduce: Compile the following .c file and run it with strace. The steps are listed below: # cat shm_example.c #include <stdio.h> #include <sys/shm.h> #include <sys/stat.h> int main () { int seg_id; char* shm_ptr; int segment_size; const int seg_siz = 1024*1024; seg_id = shmget (IPC_PRIVATE, seg_siz , IPC_CREAT | S_IRUSR | S_IWUSR ); shm_ptr = (char*) shmat (seg_id, 0, 0); shmdt (shm_ptr); shmctl (seg_id, IPC_RMID, 0); return 0; } # gcc shm_example.c -o ./a.out # strace -etrace=shmat ./a.out shmat(294912, 0, 0) = ? Actual results: # strace -etrace=shmat ./a.out shmat(294912, 0, 0) = ? Expected results: # strace -etrace=shmat ./a.out shmat(294912, 0, 0) = <the_attached_address> Additional info: I've confirmed that this is fixed in the upstream strace 4.7 version. It would be really useful to make this fix available in the RHEL 6.x release stream.