Author: dim
Date: Tue Mar 13 19:40:56 2012
New Revision: 232934
URL: http://svn.freebsd.org/changeset/base/232934

Log:
  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

Modified:
  head/contrib/gdb/gdb/target.c

Modified: head/contrib/gdb/gdb/target.c
==============================================================================
--- head/contrib/gdb/gdb/target.c       Tue Mar 13 19:18:34 2012        
(r232933)
+++ head/contrib/gdb/gdb/target.c       Tue Mar 13 19:40:56 2012        
(r232934)
@@ -1425,6 +1425,13 @@ target_resize_to_sections (struct target
              (*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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to