Re: Linux 2.6.3 doesn't suspend when mysqld is running.

From: Pavel Machek
Date: Sun Mar 21 2004 - 17:07:26 EST


Hi!

> > > even if it might be a problem in mysql, it should not be possible for an
> > > unprivileged process to make the system unable to suspend. Maybe the
> > > kernel should send SIGSTOP to those processes which can't be stopped
> > > otherwise.
> >
> > No, its definitely not problem in mysql.
> >
> > But knowing "where it sleeps in kernel" maybe would make me understand
> > what is going on. And I'm not going to install mysql just to find out.
>
> Hi,
> now I've examined the code of mysql and it seems to be a problem with signal
> handling. When a process is calling sigprocmask while suspending, the kernel
> can't stop it. If you run the code below, the system won't be able to
> suspend. After the kernel prints an error message that it can't stop the
> program, it's impossible to terminate it by any signal (even SIGKILL). The
> only way I've found to terminate the process is to send SIGKILL to it and
> then suspend the system. After resuming, the process will finally be
> > > killed.

Can you try this one? (Thanks to Nigel.).

Pavel

--- tmp/linux/arch/i386/kernel/signal.c 2004-03-11 18:10:38.000000000 +0100
+++ linux/arch/i386/kernel/signal.c 2004-03-21 22:19:23.000000000 +0100
@@ -567,7 +567,8 @@

if (current->flags & PF_FREEZE) {
refrigerator(0);
- goto no_signal;
+ if (!signal_pending(current))
+ goto no_signal;
}

if (!oldset)

>
> #include <signal.h>
> #include <errno.h>
> #include <stdlib.h>
>
> int main(int argc,char ** argv){
> sigset_t set;
> int sig;
> sigemptyset(&set);
> sigprocmask(SIG_BLOCK,&set,NULL);
> while(sigwait(&set,&sig)==EINTR);
> return 0;
> }

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/