<<< Date Index >>>     <<< Thread Index >>>

Re: Child Exited 127 Error



On Mon, Jun 26, 2006 at 05:09:32PM -0400, Kyle Wheeler wrote:
> On Monday, June 26 at 12:57 PM, quoth Bill:
> >Each time I send mail through mutt I get the error:
> >
> >Child Exited 127
> >
> >In addition, after the window closes, a message appears stating the
> >mail was not sent. But, in fact, the mail was sent and even posted in
> >the 'sent' mailbox.

Are you sure the mail is being sent?  You confirmed delivery?  This
appears to be caused by an error in sendlib.c in send_msg() -- when
mutt encounters an error, it returns S_ERR which is defined in lib.h
as 127.  There are a few things that can go wrong which can trigger
this to happen:

  - /dev/null does not exist on your system, or opening it fails
  - Mutt can't fork() a child process to run the sendmail process
  - Mutt can't find the sendmail process (maybe sendmail isn't in your
    path, and wasn't specified with a full path in your muttrc or some
    config file it sources)
  - the call to exec() fails for some other reason (rare)
  - probably a couple of other reasons I missed -- reading this code
    gives me a headache due to the awful GNU coding standards

Out of all of these, the third one I guess is the most likely.  Are you
positive you have the Postfix package installed?  Does it have a
sendmail program installed?  You can determine that with rpm -ql
postfix or dpkg -L postfix for Red Hat or Debian-based systems,
respectively.  Make sure you can see it with ls, and make sure you can
run it from the command line (i.e. you have permissions -- you don't
have to try to hand-send a message with it)...

If that's all set, type this in mutt, and see what it gives:

  :set ?sendmail

Yes, include the colon and the question mark.  This will tell you the
value of the $sendmail variable in Mutt.  That is how mutt will try to
send mail.  It may somehow have become unset or set incorrectly.

If that fails, try:

  $ ls -l /dev/null
  crw-rw-rw-  1 root root 1, 3 Jun 26 19:12 /dev/null

Your output should look like the above, except for the date.  File
ownership might be different too I suppose, but the permissions bits
and the numbers in the middle should definitely be the same.

If all that doesn't reveal anything useful, I guess we'll have to
think harder about this one...

BUT, if you're seeing this, Mutt should NOT be sending the mail.  This
message should indicate that however you're sending mail, it's
failing.

> What program are you using to send mail? It looks like it is exiting 
> with an error code but sending it anyway. Generally, a return code of 
> 127 means "killed by signal" - which could be a segfault or something 
> else. You may want to try sending an email "by hand" (i.e. `echo "foo" 
> | /whatever/program/you/use`) in order to see how it is failing.

This is actually not correct.  First, exit codes do not have any
inherent meaning.  They are controlled by the programmer, or else they
are simply the return value of the last function called which returns
something that can be converted to a char (essentially meaningless
gibberish, if the programmer didn't decide to provide an exit code
explicitly).

There are, however, some conventions that some astute programmers try
to ahdere to.  The exit code 127 usually corresponds to "path not
found" -- the file or program which the calling program was trying to
open or exec could not be found, either because of a $PATH problem, a
permissions problem, or because it simply doesn't exist.  Many of the
reasons for which mutt will return this exit code more-or-less happen
to agree with this, but also some of them do not.  Mutt does not
adhere to this convention, except by accident. ;-)

Kyle is probably confusing this with another convention: In the world
of shell scripting, the shell will return an exit code of 128 + SIGNUM
if a script is terminated by a signal (and doesn't catch the signal
and decide to return some other value).  Some program authors also try
to adhere to this convention.  But many (if not most) do not, and
again, Mutt does not.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

Attachment: pgpvXAQQty5Hz.pgp
Description: PGP signature