Bug 137709 - "sigwait returned error: 0" errors from milter
Summary: "sigwait returned error: 0" errors from milter
Alias: None
Product: Fedora
Classification: Fedora
Component: sendmail
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2004-10-31 04:43 UTC by Jonathan Kamens
Modified: 2007-11-30 22:10 UTC (History)
0 users

Clone Of:
Last Closed: 2006-07-11 14:17:33 UTC

Attachments (Terms of Use)
Cope with linux sigwait ABI (1.03 KB, patch)
2005-05-29 05:36 UTC, Jonathan Kamens
no flags Details | Diff

Description Jonathan Kamens 2004-10-31 04:43:58 UTC
I just upgraded from kernel 2.4.27-pre2-pac1 to Red Hat kernel
2.6.9-1.643smp and from glibc-2.3.3-63 to glibc-2.3.3-74.  I also
upgraded perl and sendmail to the current development versions.  I
also recompiled Sendmail::Milter against the current version of perl
and sendmail.  I have a milter written in Perl that uses
Sendmail::Milter and calls an external process by forking and execing.
 It is now logging this over and over again when I start it and then
crashing shortly after startup:

Oct 31 00:44:12 jik perl: bogofilter-milter: sigwait returned error: 0

It does seem to process some number of messages before it crashes.  I
don't know if the log message above is related to he fact that it
keeps crashing.  In any case, it would seem that I can't use this
milter until I can figure out how to resolve this issue.

Thanks for any help you can provide.

Comment 1 Jonathan Kamens 2005-05-29 05:36:07 UTC
I love it when I file a bug and it hasn't been touched seven months later.

I finally got myself a new PC and upgraded to kernel 2.6 for real and
permanently, and I was still encountering this problem, so I spent the time to
debug it myself.

The problem is that the sigwait function on Linux doesn't behave as documented.
 The man page claims, "The sigwait function never returns an error," but in fact
it can return several errors, the relevant one in this case being EINTR.  The
other problem is that when it returns an error, for some reason errno is still
0.  The first problem is a documentation error, the second one is probably a
glibc error.  I will file separate bugs about those.  In the meantime, I have
attached a patch to make libmilter function properly.

Comment 2 Jonathan Kamens 2005-05-29 05:36:50 UTC
Created attachment 114948 [details]
Cope with linux sigwait ABI

Comment 3 Jonathan Kamens 2005-05-29 05:48:32 UTC
The comment I put in my patch is probably not quite right.  It should probably
say, "sigwait returns an error code on some Linux versions and doesn't preserve

Comment 4 Jonathan Kamens 2005-05-30 13:24:08 UTC
Jakub makes an interesting point in bug 159085.  He says that the spec says
sigwait isn't supposed to touch errno, that it's supposed to return an error
code rather than putting it in errno.  That means that the code in libmilter
which is checking errno after sigwait returns a non-zero status is completely
buggy, not just bubby on Linux -- it should always be using the return value as
the error code rather than checking errno.

Comment 5 Thomas Woerner 2006-07-11 14:17:33 UTC
This has been fixed in upstream sendmail.
Closing as fixed in "RAWHIDE".

Note You need to log in before you can comment on or make changes to this bug.