Allow CK to terminate on FreeBSD

Joe Marcus Clarke marcus at marcuscom.com
Tue Sep 4 22:04:56 PDT 2007


On Tue, 2007-09-04 at 21:42 -0700, Remco Treffkorn wrote:

> > > The diff only had the BSD conditional in it. Where is the signal handler
> > > for SIGTERM, SIGQUIT, SIGHUP, and SIGINT? Why not just exit from there?
> >
> > In the meantime, simply registering SIG_DFL for SIGTERM, SIGQUIT,
> > SIGHUP, and SIGINT will work to terminate the process in the normal
> > cases.
> 
> This is really sick! Since SIG_DFL is... ahemm... the default? I think that's 
> why they call it a bug.

That's not actually the bug.  The default for BSD is to restart syscalls
rather than interrupt them.  The bug is that the kernel kept looping and
didn't allow the pending signal to clear.  With the patch, EINTR is
still not returned: the ioctl call simply restarts.

With the workaround, the ioctl call is interrupted (as on Linux), and
the kernel returns EINTR to userland.

> 
> > > You will then never even get to the goto.
> >
> > I have a new patch that simply removes the #ifdef around that goto.
> > It's not needed.
> 
> That's what I thought.
> 
> > > How is SIGKILL handled? You indicated BDS had a bug. Are you still saying
> > > that?
> >
> > SIGKILL is not handled because of the loop in the kernel.  Yes it is a
> > bug, and it will be fixed, but CK will still need a BSD workaround in
> > the meantime.
> 
> Thanks. Now it makes sense to me. That is a nasty bug to have, and I am glad 
> you found it.
> 
> It would be nice, if you could track that, and remove the workaround when the 
> kernel is fixed.

I will just use the patch locally as there is no reason to commit it
upstream.

Joe

-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/hal/attachments/20070905/97789040/attachment.pgp 


More information about the hal mailing list