Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2012 19:40:56 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232934 - head/contrib/gdb/gdb
Message-ID:  <201203131940.q2DJeu8u059410@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203131940.q2DJeu8u059410>