From owner-cvs-all Sat May 15 21:13: 9 1999 Delivered-To: cvs-all@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 7BA1C14CC5; Sat, 15 May 1999 21:13:06 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id AAA06902; Sun, 16 May 1999 00:12:25 -0400 (EDT) Date: Sun, 16 May 1999 00:12:25 -0400 (EDT) From: Daniel Eischen Message-Id: <199905160412.AAA06902@pcnet1.pcnet.com> To: des@flood.ping.uio.no, jb@cimlogic.com.au Subject: Re: cvs commit: src/lib/libc_r/uthread Makefile.inc pthread_private.h uthread_cond.c uthread_create.c uthread_detach.c Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, jb@FreeBSD.ORG, paul@mu.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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