Bug 265941
| Summary: | ltrace can't follow the child process. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Gui Jianfeng <guijianfeng> | ||||||
| Component: | ltrace | Assignee: | Petr Machata <pmachata> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | |||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 5.0 | CC: | ebachalo, jbastian, mnewsome, mnowak, syeghiay, tao | ||||||
| Target Milestone: | beta | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | ia64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2009-03-18 15:00:46 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Created attachment 180181 [details]
This is a patch to fix this issue.
This bug still exists in RHEL5.1. Created attachment 333069 [details]
Fix for RHEL-5
This patch uses the same approach to solve the problem as strace does, namely that it assumes that unknown pid that occurs in follow-fork mode is a new child, and starts tracing it.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-0380.html |
Description of problem: if use "ltrace -f" to trace a process which could create a new process, ltrace can't trace the new created process. I have made a patch to fix this issue. Version-Release number of selected component (if applicable): RHEL5 How reproducible: 100% Steps to Reproduce: #ltrace -f ./child the child will create a new process by fork() Actual results: ltrace fails to trace the new created process, it reported as follow: fork(Cannot attach to pid 18609: Operation not permitted signal from wrong pid 18609 ?!? Expected results: ltrace shall trace the new created process. Additional info: traced program child.c is as follow: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <signal.h> int main() { pid_t pid; pid = fork(); if(pid == 0) { printf("This is child\n"); sleep(1); } else if(pid > 0) { printf("This is parent\n"); } else { exit(1); } exit(0); }