Skip to content

Commit

Permalink
Pull in a fix (still under GPLv2) for a double free in gdb, leading to
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DimitryAndric committed Mar 13, 2012
1 parent 4391754 commit 9c5cee1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/gdb/gdb/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9c5cee1

Please sign in to comment.