[Pkg-voip-commits] r2940 - in twinkle/trunk/debian: . patches

Mark Purcell msp at alioth.debian.org
Thu Jan 4 14:45:04 CET 2007


Author: msp
Date: 2007-01-04 14:45:04 +0100 (Thu, 04 Jan 2007)
New Revision: 2940

Added:
   twinkle/trunk/debian/patches/memman.patch
Modified:
   twinkle/trunk/debian/changelog
Log:
* Apply upstream memman.patch to fix random twinkle crashes

Modified: twinkle/trunk/debian/changelog
===================================================================
--- twinkle/trunk/debian/changelog	2007-01-04 13:41:15 UTC (rev 2939)
+++ twinkle/trunk/debian/changelog	2007-01-04 13:45:04 UTC (rev 2940)
@@ -1,9 +1,10 @@
-twinkle (1:0.9-6) unstable; urgency=low
+twinkle (1:0.9-6) unstable; urgency=medium
 
   * Rebuild for libcommoncpp2 soname change
     - crash on call end (Closes: #402509)
+  * Apply upstream memman.patch to fix random twinkle crashes
 
- -- Mark Purcell <msp at debian.org>  Fri,  5 Jan 2007 00:40:21 +1100
+ -- Mark Purcell <msp at debian.org>  Fri,  5 Jan 2007 00:43:45 +1100
 
 twinkle (1:0.9-5) unstable; urgency=low
 

Added: twinkle/trunk/debian/patches/memman.patch
===================================================================
--- twinkle/trunk/debian/patches/memman.patch	2007-01-04 13:41:15 UTC (rev 2939)
+++ twinkle/trunk/debian/patches/memman.patch	2007-01-04 13:45:04 UTC (rev 2940)
@@ -0,0 +1,61 @@
+Index: src/audits/memman.cpp
+===================================================================
+--- src/audits/memman.cpp	(revision 223)
++++ src/audits/memman.cpp	(working copy)
+@@ -114,13 +114,22 @@
+ 		return;
+ 	}
+ 
+-	pointer_map.erase(p);
++
+ 	bool array_mismatch = (is_array != i->second.is_array);
+-	mtx_memman.unlock();
+ 
+ 	// Check mixing of array new/delete
++	// NOTE: after the pointer has been erased from pointer_map, the
++	//       iterator i is invalid.
++	//       The mutex mtx_memman should be unlocked before logging to
++	//       avoid dead locks.
+ 	if (array_mismatch) {
+ 		num_array_mixing++;
++		string allocation_filename = i->second.filename;
++		int allocation_lineno = i->second.lineno;
++		bool allocation_is_array = i->second.is_array;
++		pointer_map.erase(p);
++		mtx_memman.unlock();
++		
+ 		log_file->write_header("t_memman::trc_delete",
+ 			LOG_MEMORY, LOG_WARNING);
+ 		log_file->write_raw(filename);
+@@ -130,21 +139,24 @@
+ 		log_file->write_raw(ptr2str(p));
+ 		log_file->write_raw(" is deleted ");
+ 		if (is_array) {
+-			log_file->write_raw(" as array (delete []).\n");
++			log_file->write_raw("as array (delete []).\n");
+ 		} else {
+-			log_file->write_raw(" normally (delete).\n");
++			log_file->write_raw("normally (delete).\n");
+ 		}
+ 		log_file->write_raw("But it was allocated ");
+-		if (i->second.is_array) {
+-			log_file->write_raw(" as array (new []) \n");
++		if (allocation_is_array) {
++			log_file->write_raw("as array (new []) \n");
+ 		} else {
+-			log_file->write_raw(" normally (new) \n");
++			log_file->write_raw("normally (new) \n");
+ 		}
+-		log_file->write_raw(i->second.filename);
++		log_file->write_raw(allocation_filename);
+ 		log_file->write_raw(", line ");
+-		log_file->write_raw(i->second.lineno);
++		log_file->write_raw(allocation_lineno);
+ 		log_file->write_endl();
+ 		log_file->write_footer();
++	} else {
++		pointer_map.erase(p);
++		mtx_memman.unlock();
+ 	}
+ }
+ 




More information about the Pkg-voip-commits mailing list