diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-27 19:33:20 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-27 19:33:20 +0200 |
commit | 1e339e00198972a75892d5073d47f090db5d77a2 (patch) | |
tree | 2289aa8ae2fab49b25de1ac9b93491813e6f1dd4 /proc.c | |
parent | b6de841675aab74d1700aa379535b76ef183bec2 (diff) | |
download | ltrace-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |