aboutsummaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-27 19:33:20 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-27 19:33:20 +0200
commit1e339e00198972a75892d5073d47f090db5d77a2 (patch)
tree2289aa8ae2fab49b25de1ac9b93491813e6f1dd4 /proc.c
parentb6de841675aab74d1700aa379535b76ef183bec2 (diff)
downloadltrace-1e339e00198972a75892d5073d47f090db5d77a2.tar.gz
Libraries and breakpoints should be cloned from original's leader
This pops up when a thread calls vfork. In that case there are no libraries assigned to the process itself, but newly-vfork'd process is itself a leader, and therefore needs its own libraries and breakpoints.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index bf7f3ad..3134ce9 100644
--- a/proc.c
+++ b/proc.c
@@ -348,7 +348,7 @@ process_clone(struct Process *retp, struct Process *proc, pid_t pid)
* breakpoints. */
struct library *lib;
struct library **nlibp = &retp->libraries;
- for (lib = proc->libraries; lib != NULL; lib = lib->next) {
+ for (lib = proc->leader->libraries; lib != NULL; lib = lib->next) {
*nlibp = malloc(sizeof(**nlibp));
if (*nlibp == NULL
|| library_clone(*nlibp, lib) < 0) {
@@ -375,7 +375,7 @@ process_clone(struct Process *retp, struct Process *proc, pid_t pid)
.new_proc = retp,
.error = 0,
};
- dict_apply_to_all(proc->breakpoints, &clone_single_bp, &data);
+ dict_apply_to_all(proc->leader->breakpoints, &clone_single_bp, &data);
if (data.error < 0)
goto fail2;