From mrsam@courier-mta.com Wed Jul 3 23:13:43 2002 Return-Path: Delivered-To: leitner-fefe-leitner@fefe.de Received: (qmail 10354 invoked from network); 3 Jul 2002 21:13:43 -0000 Received: from mail.courier-mta.com (66.92.103.29) by fefe.de with DES-CBC3-SHA encrypted SMTP; 3 Jul 2002 21:13:43 -0000 Received: from localhost (localhost [127.0.0.1]) (uid 502) by ny.email-scan.com with local; Wed, 03 Jul 2002 17:13:32 -0400 References: <20020703202105.GF9380@codeblau.de> In-Reply-To: <20020703202105.GF9380@codeblau.de> From: Sam Varshavchik To: Felix von Leitner Subject: Re: courier configure bug (waitlib) Date: Wed, 03 Jul 2002 17:13:32 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: Status: RO X-Status: A Content-Length: 3422 Felix von Leitner writes: > Hi! > > I think I sent you an email about this before, but here you go: > > Trying to build courier-imapd with the diet libc fails. Here is a > configure excerpt (in waitlib): > > checking for pid_t... yes > checking return type of signal handlers... void > checking for wait... yes > checking for wait3... yes > checking for sigblock... no > checking if wait function is broken... yes > configure: error: I give up -- neither wait nor wait3 works properly > > Now, this is curious. I extracted your test program and I am not sure > what it is supposed to check, It is supposed to check whether wait() or wait3() should be used in response to a SIGCHLD. > but it sure as hell does not check whether > wait or wait3 work. Here is an strace with the number of processes cut > down to 1 for brevity: > > execve("./t", ["./t"], [/* 51 vars */]) = 0 > pipe([3, 4]) = 0 > pipe([5, 6]) = 0 > rt_sigaction(SIGCHLD, {0x80481a6, [CHLD], SA_RESTART}, {SIG_DFL}, 8) = 0 > fork() = 27522 > [pid 27521] close(6) = 0 > [pid 27521] close(3) = 0 > [pid 27521] read(5, > [pid 27522] close(4) = 0 > [pid 27522] close(5) = 0 > [pid 27522] close(6 > [pid 27521] <... read resumed> "", 1) = 0 > [pid 27521] rt_sigaction(SIGCHLD, {SIG_DFL}, {0x80481a6, [CHLD], > SA_RESTART}, 8) = 0 > [pid 27521] close(5) = 0 > [pid 27521] close(4) = 0 > [pid 27521] nanosleep({3, 0}, > [pid 27522] <... close resumed> ) = 0 > [pid 27522] read(3, "", 1) = 0 > [pid 27522] _exit(0) = ? > <... nanosleep resumed> 0xbffff774) = -1 EINTR (Interrupted system > call) > --- SIGCHLD (Child exited) --- > time([1025727232]) = 1025727232 > rt_sigaction(SIGCHLD, {0x80481a6, [CHLD], SA_RESTART}, {SIG_DFL}, 8) = 0 > nanosleep({3, 0}, {3, 0}) = 0 > time(NULL) = 1025727235 > _exit(1) = ? > > As you can see, everything behaves exactly as it should. The signal > handler is not called because the parent process sets it to SIG_DFL > before the child exits. This is not triggered with glibc because glibc > provides legacy BSD crap signal handling functions, which courier-imapd > happily prefers to the POSIX standard (why?). If I compile this test > program with the same confdefs.h from the diet libc (i.e. > > #define HAVE_SYS_WAIT_H 1 > #define HAVE_UNISTD_H 1 > #define STDC_HEADERS 1 > #define RETSIGTYPE void > #define HAVE_WAIT 1 > #define HAVE_WAIT3 1 > > ), the test program exhibits the same behaviour with glibc. Please fix > your test program. Removing the call to wait_block appears to reinstate > the behaviour your code expects. Also, the implementation of wait_block > appears to be flawed. It should use sigprocmask and not SIG_DFL, I > think. > > Comments? It is dietlibc's responsibility to remain compatible with glibc, and not the other way around. And, of course, if you use the broken dietlibc configuration with glibc, it's not going to work. What the hell did you expect? -- Sam