Bug 137709 - "sigwait returned error: 0" errors from milter
"sigwait returned error: 0" errors from milter
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: sendmail (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-31 00:43 EDT by Jonathan Kamens
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-11 10:17:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Jonathan Kamens 2004-10-31 00:43:58 EDT
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 01:36:07 EDT
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 01:36:50 EDT
Created attachment 114948 [details]
Cope with linux sigwait ABI
Comment 3 Jonathan Kamens 2005-05-29 01:48:32 EDT
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
errno."
Comment 4 Jonathan Kamens 2005-05-30 09:24:08 EDT
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 10:17:33 EDT
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.