summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-03-13 19:40:56 +0000
committerdim <dim@FreeBSD.org>2012-03-13 19:40:56 +0000
commitb17841f4d2ac6e5e7fa3a9ffadbdb8c97acd19e8 (patch)
tree254e37d2140c102499d0367ccbccdeedd54c075b /contrib
parent181468133124a1c1985ea494e82b209c11572f4e (diff)
downloadFreeBSD-src-b17841f4d2ac6e5e7fa3a9ffadbdb8c97acd19e8.zip
FreeBSD-src-b17841f4d2ac6e5e7fa3a9ffadbdb8c97acd19e8.tar.gz
Pull in a fix (still under GPLv2) for a double free in gdb, leading to
an assert, which can occur if you repeatedly dlopen() and dlclose() a .so file in a tight loop. This was reported on freebsd-current@ by Alexandre Martins, with a sample to reproduce the behaviour. Obtained from: http://sourceware.org/git/?p=gdb.git;a=commit;h=a6f2cbb341520f8e100f4b8305979dd6207a79e8
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gdb/gdb/target.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/target.c b/contrib/gdb/gdb/target.c
index ff47ac1..1f703dd 100644
--- a/contrib/gdb/gdb/target.c
+++ b/contrib/gdb/gdb/target.c
@@ -1425,6 +1425,13 @@ target_resize_to_sections (struct target_ops *target, int num_added)
(*t)->to_sections_end = target->to_sections_end;
}
}
+ /* There is a flattened view of the target stack in current_target,
+ so its to_sections pointer might also need updating. */
+ if (current_target.to_sections == old_value)
+ {
+ current_target.to_sections = target->to_sections;
+ current_target.to_sections_end = target->to_sections_end;
+ }
}
return old_count;
OpenPOWER on IntegriCloud