[asterisk-commits] mjordan: branch mjordan/trunk-deadlock r376141 - /team/mjordan/trunk-deadlock...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 12 12:15:52 CST 2012
Author: mjordan
Date: Mon Nov 12 12:15:47 2012
New Revision: 376141
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376141
Log:
Another check on the thread ID
This time with some process IDs.
Modified:
team/mjordan/trunk-deadlock/main/asterisk.c
team/mjordan/trunk-deadlock/main/lock.c
Modified: team/mjordan/trunk-deadlock/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-deadlock/main/asterisk.c?view=diff&rev=376141&r1=376140&r2=376141
==============================================================================
--- team/mjordan/trunk-deadlock/main/asterisk.c (original)
+++ team/mjordan/trunk-deadlock/main/asterisk.c Mon Nov 12 12:15:47 2012
@@ -499,12 +499,7 @@
void ast_register_thread(char *name)
{
struct thread_list_t *new = ast_calloc(1, sizeof(*new));
- static int first_time = 0;
-
- if (!first_time) {
- fprintf(stderr, "First registered thread %lx\n", pthread_self());
- first_time = 1;
- }
+
if (!new)
return;
new->id = pthread_self();
@@ -3980,7 +3975,6 @@
if (daemon(1, 0) < 0) {
ast_log(LOG_ERROR, "daemon() failed: %s\n", strerror(errno));
}
- fprintf(stderr, "daemon finished\n");
ast_mainpid = getpid();
/* Blindly re-write pid file since we are forking */
unlink(ast_config_AST_PID);
@@ -4029,7 +4023,7 @@
/* Kill the canary when we exit */
ast_register_atexit(canary_exit);
}
-
+ fprintf(stderr, "Asterisk (startup) pid: %ld\n", (long)getpid());
if (ast_event_init()) {
printf("%s", term_quit());
exit(1);
Modified: team/mjordan/trunk-deadlock/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-deadlock/main/lock.c?view=diff&rev=376141&r1=376140&r2=376141
==============================================================================
--- team/mjordan/trunk-deadlock/main/lock.c (original)
+++ team/mjordan/trunk-deadlock/main/lock.c Mon Nov 12 12:15:47 2012
@@ -1005,15 +1005,16 @@
__dump_backtrace(<->backtrace[lt->reentrancy], 0);
abort();
}
- ast_bt_get_addresses(<->backtrace[0]);
- bt = <->backtrace[0];
+ lt->thread[0] = pthread_self();
lt->file[0] = filename;
lt->lineno[0] = line;
lt->func[0] = func;
- lt->thread[0] = pthread_self();
+ ast_bt_get_addresses(<->backtrace[0]);
+ bt = <->backtrace[0];
if (ast_reentrancy_unlock(lt)) {
fprintf(stderr, "Original thread ID %lx\n", lt->thread[0]);
fprintf(stderr, "Current thread ID %lx\n", pthread_self());
+ fprintf(stderr, "Asterisk (crashing) pid: %ld\n", (long)getpid());
__dump_backtrace(<->backtrace[lt->reentrancy], 0);
abort();
}
More information about the asterisk-commits
mailing list