aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-27 01:01:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-27 01:01:47 +0000
commit0525b440d2e147a3873812ef00796c7f7d0151b1 (patch)
treed335b280fe836edb2e2996a4b80a67f2831955eb
parentdb029c0ce2d9f4ad2a739ce7b34faddd44cd0432 (diff)
make this comment explain the situation in an even more explicit fashion
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94824 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/manager.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/main/manager.c b/main/manager.c
index 6d7cc3fc1..8e3309667 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2284,11 +2284,17 @@ static void *session_do(void *data)
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.
- */
+ /* It is possible under certain circumstances for this session thread
+ to complete its work and exit *before* the thread that created it
+ has finished executing the ast_pthread_create_background() function.
+ If this occurs, some versions of glibc appear to act in a buggy
+ fashion and attempt to write data into memory that it thinks belongs
+ to the thread but is in fact not owned by the thread (or may have
+ been freed completely).
+
+ Causing this thread to yield to other threads at least one time
+ appears to work around this bug.
+ */
usleep(1);
destroy_session(s);