Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: library/3179: bug report

From: Marco S Hyman <marc(at)snafu.org>
Date: Wed Apr 30 2003 - 00:15:02 EDT


The following reply was made to PR library/3179; it has been noted by GNATS.

From: Marco S Hyman <marc@snafu.org>
To: "Terry" <kewl@compfort.pl>
Cc: gnats@openbsd.org
Subject: Re: library/3179: bug report
Date: Tue, 29 Apr 2003 20:57:07 -0700

  > here is the gdb's backtrace of mysqld:  

 Thank you again, that helped a lot. Please apply the following patch:  

$ cd /usr/src/lib/libpthread
$ patch < this-message
$ make obj
$ make depend
$ make
$ sudo make install

 

 and let me know if it resolves the problem. The patch fixes two race  conditions that would cause the problem you ran into if triggered. I'm  hoping this resolves your problem.  

 // marc  

 Index: uthread/uthread_kill.c



 RCS file: /cvs/src/lib/libpthread/uthread/uthread_kill.c,v  retrieving revision 1.10
 diff -u -p -r1.10 uthread_kill.c
  • uthread/uthread_kill.c 31 Jan 2003 04:46:17 -0000 1.10 +++ uthread/uthread_kill.c 30 Apr 2003 03:53:06 -0000 @@ -43,6 +43,7 @@ pthread_kill(pthread_t pthread, int sig) ret = _find_thread(pthread); if (sig != 0) { if (_thread_sigact[sig - 1].sa_handler != SIG_IGN) { + _thread_kern_sig_defer(); if (pthread->state == PS_SIGWAIT && sigismember(pthread->data.sigwait, sig)) { PTHREAD_NEW_STATE(pthread,PS_RUNNING); @@ -51,6 +52,7 @@ pthread_kill(pthread_t pthread, int sig) _thread_kill_siginfo(sig); _thread_signal(pthread,sig); } + _thread_kern_sig_undefer(); } } } else Index: uthread/uthread_sig.c
    RCS file: /cvs/src/lib/libpthread/uthread/uthread_sig.c,v retrieving revision 1.19 diff -u -p -r1.19 uthread_sig.c
  • uthread/uthread_sig.c 31 Jan 2003 04:46:17 -0000 1.19 +++ uthread/uthread_sig.c 30 Apr 2003 03:53:06 -0000 @@ -64,6 +64,7 @@ void _thread_sig_handler(int sig, siginfo_t *info, struct sigcontext * scp) { struct pthread *curthread = _get_curthread(); + int dispatch; char c;
Do you need help?X

          if (sig == _SCHED_SIGNAL) {
 @@ -131,7 +132,10 @@ _thread_sig_handler(int sig, siginfo_t *

  			_thread_sys_write(_thread_kern_pipe[1], &c, 1);
  			_sigq_check_reqd = 1;
  		} else {
 -			if (_thread_sig_handle(sig, scp))
 +			_queue_signals = 1;
 +			dispatch = _thread_sig_handle(sig, scp);
 +			_queue_signals = 0;
 +			if (dispatch)
  				_dispatch_signals(scp);
  		}
  	}

 @@ -160,7 +164,7 @@ _thread_clear_pending(int sig, pthread_t   
  /*
   * Process the given signal.   Returns 1 if the signal may be dispatched,
 - * otherwise 0.
 + * otherwise 0.   Signals MUST be defered when this function is called.
   */

  int
  _thread_sig_handle(int sig, struct sigcontext * scp) Received on Wed Apr 30 00:15:04 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:56 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library