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.
Cause: The "catch syscall" command uses a special type of breakpoint inside GDB, which is not maintained by the regular code that handles normal breakpoints. However, GDB was incorrectly removing these system call catchpoints when the program being debugged forked itself, which made GDB miss any subsequent system call that needed to be caught.
Consequence: GDB would not be able to properly catch a system call in the parent process after a call to "fork".
Fix: The fix consists in not removing a system call catchpoint from a program that forked itself.
Result: GDB is now able to correctly stop at a system call that is called from the parent process after it has forked.
https://sourceware.org/bugzilla/show_bug.cgi?id=13457
This problem does not happen in fedora 20:
$ rpm -q gdb
gdb-7.7.1-18.fc20.x86_64
but happens in rhel-6.4 (after updates):
$ rpm -q gdb
gdb-7.2-64.el6_5.2.x86_64
and also happens in rhel-7:
$ rpm -q gdb
gdb-7.6.1-51-el7.x86_64
Created attachment 943729[details]
test-catch-mprotect.c
I created this simple test before opening the bug report.
Compile it as:
$ gcc -pthead -O0 -g3 -o test-catch-mprotect test-catch-mprotect.c
The original problem report is gdb not catch'ing mprotect.
The test program accepts "-t" to run mprotect in a new thread,
"-f" after fork, or by default in a simple test routine.
But to actually test the reported problem, it suffices to run
the simple test in the sourceware bug report, as the more complete
test case, added here for extra information, only triggers the
problem for fork. Anyway, example of use:
$ gdb test-catch-mprotect
(gdb) b main
(gdb) r -f
(gdb) catch syscall mprotect
(gdb) c
if not also executing:
(gdb) set fork-follow-mode child
it will not stop in mprotect for the affected systems.
So far only confirmed to work in fedora 20 (but mosy likely
will work on newer fedora).
Comment 3Sergio Durigan Junior
2014-10-03 20:09:26 UTC
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-1325.html