[asterisk-commits] tilghman: branch 1.4 r94808 - /branches/1.4/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 26 14:43:38 CST 2007


Author: tilghman
Date: Wed Dec 26 14:43:38 2007
New Revision: 94808

URL: http://svn.digium.com/view/asterisk?view=rev&rev=94808
Log:
Workaround for what is probably a glibc bug (but we'll see this crop up again
and again, if we don't add the workaround).
Reported by: rolek
Patch by: tilghman
(Closes issue #11601, closes issue #11426)

Modified:
    branches/1.4/main/manager.c

Modified: branches/1.4/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/manager.c?view=diff&rev=94808&r1=94807&r2=94808
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Wed Dec 26 14:43:38 2007
@@ -2283,6 +2283,14 @@
 		}
 		ast_log(LOG_EVENT, "Failed attempt from %s\n", ast_inet_ntoa(s->sin.sin_addr));
 	}
+
+	/* If the entire session occurs in a single context switch, then it's
+	 * possible to get an unsafe memory condition by free()ing the memory
+	 * before letting other threads run at least once.  This actually seems
+	 * like a workaround for a glibc bug.
+	 */
+	usleep(1);
+
 	destroy_session(s);
 	return NULL;
 }




More information about the asterisk-commits mailing list