OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
MySQL compiled from ports tree crashing on OpenBSD 3.3

madeyopenbsd.pl
Date: Sun Apr 27 2003 - 17:10:44 CDT


>Number: 3238
>Category: library
>Synopsis: MySQL compiled from ports tree crashing on OpenBSD 3.3
>Confidential: yes
>Severity: serious
>Priority: high
>Responsible: bugs
>State: closed
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Apr 27 22:20:01 GMT 2003
>Closed-Date: Wed Apr 30 11:56:01 MDT 2003
>Last-Modified: Wed Apr 30 11:56:01 MDT 2003
>Originator: Madey
>Release: 3.3
>Organization:
net
>Environment:

 System : OpenBSD 3.3
 Architecture: OpenBSD.i386
 Machine : i386
 Kernel : GENERIC
 Libraries :
 /usr/local/libexec/mysqld:
  -lwrap.3 => /usr/lib/libwrap.so.3.0 (0x40241000)
  -lz.2 => /usr/lib/libz.so.2.0 (0x40249000)
  -lm.1 => /usr/lib/libm.so.1.0 (0x40256000)
  -lpthread.1 => /usr/lib/libpthread.so.1.0 (0x4026a000)
  -lc.29 => /usr/lib/libc.so.29.0 (0x40281000)

>Description:
 MySQL 3.23.55 (mysqld) from OpenBSD 3.3 ports tree is frequently crashing.
 After crash mysqld is restarted by safe_mysqld script. After some restarts
mysqld
 stops responding to requests.

 MySQL error message from log file:
 pid 12096: Fatal error '_pq_first: pq_active' at line 219 in file
/usr/src/lib/libpthread/uthread/uthread_priority_queue.c (errno = 35)
 Abort
 030427 23:47:51 mysqld restarted

 On OpenBSD 3.2 (on that machine) MySQL works OK.

>How-To-Repeat:
 # cd /usr/ports/databases/mysql && make install
 # /usr/local/bin/safe_mysqld &

 Wait few hours (generate some load) - mysql will restart itself.
>Fix:
 None known.

>Release-Note:
>Audit-Trail:

From: Marco S Hyman <marcsnafu.org>
To: madeyopenbsd.pl
Cc: gnatsopenbsd.org
Subject: Re: library/3238: MySQL compiled from ports tree crashing on OpenBSD
3.3
Date: Tue, 29 Apr 2003 21:06:21 -0700

 Please apply the following patch to libpthread and try again.

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

 Please let me know if 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;

   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)

State-Changed-From-To: open->closed
State-Changed-By: marc
State-Changed-When: Wed Apr 30 11:54:25 MDT 2003
State-Changed-Why:
suggested patch resolved problem. Verified by author of pr #3179
which is the same bug.
>Unformatted:

------------------------------------------------------------
This email has been scanned for virus activity.

NO Virus Found

shmeg.com cannot guarentee that this email and/or any
attachments are not infected, but have scanned with
automatically updated anti virus software. As such,
shmeg.com cannot be held legally liable for any infection
to any device, due to the opening of this email.

For questions/comments, please contact our mail support
team at postmastershmeg.com

The Software and Hardware, Maintenance and Engineering Group
www.shmeg.com
------------------------------------------------------------