Bug 742340 - ltrace cannot properly handle multi-threaded processes
Summary: ltrace cannot properly handle multi-threaded processes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ltrace
Version: 6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Machata
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
: 806241 (view as bug list)
Depends On: 526007
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-29 19:02 UTC by Petr Machata
Modified: 2018-11-27 19:30 UTC (History)
5 users (show)

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.
Clone Of:
Environment:
Last Closed: 2012-06-20 14:28:54 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Legacy) 42871 0 None None None Never
Red Hat Product Errata RHBA-2012:0926 0 normal SHIPPED_LIVE ltrace bug fix and enhancement update 2012-06-19 20:46:02 UTC

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


Note You need to log in before you can comment on or make changes to this bug.