From owner-freebsd-current@FreeBSD.ORG Wed Oct 15 07:54:45 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B61FF16A4B3; Wed, 15 Oct 2003 07:54:45 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F200443FA3; Wed, 15 Oct 2003 07:54:44 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9FEsfFY049166; Wed, 15 Oct 2003 07:54:43 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <3F8D623B.1030101@freebsd.org> Date: Wed, 15 Oct 2003 23:05:31 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5b) Gecko/20031004 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexander Motin References: <3F8D5345.90007@alkar.net> In-Reply-To: <3F8D5345.90007@alkar.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org Subject: Re: KSE & MySQL & rc.d X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2003 14:54:45 -0000 Alexander Motin wrote: > Hi. > > This patch did not fix the problem. On the 4th boot system hang with > same symptoms. > > Daniel Eischen wrote: > >>> I have P4 system with SMP kernel and HyperThreading enabled. >>> I have one strange problem with mysql 4.1.0 when using KSE on >>> 5.1-CURRENT. >> I have been running MySQL 4.1.0 on my SMP machine for monthes, it is not P4 HyperThreading, but a dual P3 machine, it just works fine for me. >>> After building mysql server with libkse as thread library and adding >>> its start script into /usr/local/etc/rc.d, system hangs on boot >>> without any error message when mysql trying to start. >> Did kernel lock up or can you press ctrl+c to see if you can interrupt it ? >>> If I trying to start mysql by hands after system completely boot >>> then everything works just fine. >>> If I add delay into mysql start script and run it in backgroud from >>> rc.d - everything is fine >> If you build mysql from ports, it should install script mysql-server.sh under /usr/local/etc/rc.d, the default script will run mysqld_safe in background, I am confused that you need to manually turn it into background, the work should be done atomically by the script. >>> If I build mysql without KSE it works fine. >> >> >> >> I'm not sure, but try this patch; it duplicates what libc_r does. >> > Index: thread/thr_init.c > =================================================================== > RCS file: /opt/FreeBSD/cvs/src/lib/libpthread/thread/thr_init.c,v > retrieving revision 1.60 > diff -u -r1.60 thr_init.c > --- thread/thr_init.c 18 Aug 2003 03:58:29 -0000 1.60 > +++ thread/thr_init.c 7 Oct 2003 13:30:54 -0000 > @@ -251,6 +251,10 @@ > PANIC("Can't set login to root"); > if (__sys_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) > PANIC("Can't set controlling terminal"); > + if (__sys_dup2(fd, 0) == -1 || > + __sys_dup2(fd, 1) == -1 || > + __sys_dup2(fd, 2) == -1) > + PANIC("Can't dup2"); > } > > /* Initialize pthread private data. */ >