Bug 742340

Summary: ltrace cannot properly handle multi-threaded processes
Product: Red Hat Enterprise Linux 6 Reporter: Petr Machata <pmachata>
Component: ltraceAssignee: Petr Machata <pmachata>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: law, mnewsome, mnowak, mpoole, rdassen
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Tracing of multi-threaded processes When tracing processes with more than one thread, the ltrace utility would neglect to trace threads other than the main thread. But because threads share address space, those other threads would still see breakpoints distributed by ltrace. Consequently, those threads would be killed by a SIGTRAP signal. Red Hat Enterprise Linux 6.3 includes thread-awareness and breakpoint handling mechanisms. Support for tracing of multi-threaded processes is now on par with tracing single-threaded process.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 14:28:54 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:
Bug Depends On: 526007    
Bug Blocks:    

Description Petr Machata 2011-09-29 19:02:47 UTC
Description of problem:
The gist is that multi-threaded programs are killed or misbehave when traced by ltrace.  ltrace needs to implements a proper support for tracing processes with shared address space.

See bug 526007 for detailed analysis and fixes for this problem.  That bug was cloned for z-stream, and that means that it will end up in mainline eventually, too.  In order to avoid a regression, we have to fix this bug in RHEL 6, too.

We ship mostly the same version of ltrace in RHEL 6 as in RHEL 5, so the effort in porting the patch series should be minor.

Comment 1 Petr Machata 2011-09-29 19:38:29 UTC
Note that bug 738254 lists a customer request for packaging ltrace 0.6 for RHEL 6.  That would make the porting effort close to nil, the same ltrace version is in Fedora 16, and the threading fixes (modulo the vfork fix) have been included in that package, too.

Comment 6 Petr Machata 2012-02-23 15:26:20 UTC
This has now been forward-ported from RHEL 5 and is in the repository.

Comment 8 Petr Machata 2012-03-23 11:35:31 UTC
*** Bug 806241 has been marked as a duplicate of this bug. ***

Comment 12 Petr Machata 2012-05-11 22:16:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When tracing processes with more than one thread, ltrace would neglect to trace threads other than the main thread.  But because threads share address space, those other threads would still see breakpoints distributed by ltrace.  Consequently, those threads would be killed by a signal SIGTRAP.  This issue was fixed by implementing thread-awareness and breakpoint handling mechanisms.  With this fix, support for tracing of multi-threaded processes is on par with tracing single-threaded process.

Comment 13 Martin Prpič 2012-05-21 08:52:28 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,2 @@
-When tracing processes with more than one thread, ltrace would neglect to trace threads other than the main thread.  But because threads share address space, those other threads would still see breakpoints distributed by ltrace.  Consequently, those threads would be killed by a signal SIGTRAP.  This issue was fixed by implementing thread-awareness and breakpoint handling mechanisms.  With this fix, support for tracing of multi-threaded processes is on par with tracing single-threaded process.+Tracing of multi-threaded processes
+When tracing processes with more than one thread, the ltrace utility would neglect to trace threads other than the main thread. But because threads share address space, those other threads would still see breakpoints distributed by ltrace. Consequently, those threads would be killed by a SIGTRAP signal. Red Hat Enterprise Linux 6.3 includes thread-awareness and breakpoint handling mechanisms. Support for tracing of multi-threaded processes is now on par with tracing single-threaded process.

Comment 14 errata-xmlrpc 2012-06-20 14:28:54 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.

http://rhn.redhat.com/errata/RHBA-2012-0926.html