Date: Sun, 16 May 1999 00:12:25 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: des@flood.ping.uio.no, jb@cimlogic.com.au Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, jb@FreeBSD.ORG, paul@mu.org Subject: Re: cvs commit: src/lib/libc_r/uthread Makefile.inc pthread_private.h uthread_cond.c uthread_create.c uthread_detach.c Message-ID: <199905160412.AAA06902@pcnet1.pcnet.com>
index | next in thread | raw e-mail
John Birrell wrote:
> I just want to know if the core dump is in a call to longjmp. If it
> is, then my guess is that the core dump is occurring after a low
> priority thread has just been joined and detached.
This does seem to be the problem. The following patch lets
me run simple mysqladmin commands without dumping core.
Dan Eischen
eischen@vigrid.com
Index: uthread_exit.c
===================================================================
RCS file: /opt/b/CVS/src/lib/libc_r/uthread/uthread_exit.c,v
retrieving revision 1.7
diff -c -r1.7 uthread_exit.c
*** uthread_exit.c 1999/03/23 05:07:55 1.7
--- uthread_exit.c 1999/05/15 23:44:23
***************
*** 164,175 ****
if (pthread_cond_signal(&_gc_cond) != 0)
PANIC("Cannot signal gc cond");
/* Unlock the garbage collector mutex: */
if (pthread_mutex_unlock(&_gc_mutex) != 0)
PANIC("Cannot lock gc mutex");
/* This this thread will never be re-scheduled. */
! _thread_kern_sched_state(PS_DEAD, __FILE__, __LINE__);
/* This point should not be reached. */
PANIC("Dead thread has resumed");
--- 164,181 ----
if (pthread_cond_signal(&_gc_cond) != 0)
PANIC("Cannot signal gc cond");
+ /*
+ * Mark the thread as dead so it will not return if it
+ * gets context switched out when the mutex is unlocked.
+ */
+ PTHREAD_SET_STATE(_thread_run, PS_DEAD);
+
/* Unlock the garbage collector mutex: */
if (pthread_mutex_unlock(&_gc_mutex) != 0)
PANIC("Cannot lock gc mutex");
/* This this thread will never be re-scheduled. */
! _thread_kern_sched(NULL);
/* This point should not be reached. */
PANIC("Dead thread has resumed");
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905160412.AAA06902>
