Postfix 'local' crashes

Bug #774852 reported by Albrecht Dreß
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Invalid
High
Unassigned

Bug Description

Binary package hint: postfix

Ubuntu version: Ubuntu 11.04
Package version: postfix 2.8.2-1ubuntu1
System: PowerMac G4 "Silver"

After an update of my box from 10.10 to 11.04, the 'local' delivery agent of Postfix stopped working. I added verbose debugging for it in /etc/postfix/master.cf, and get the following results in /var/log/mail.log:

May 1 14:34:23 antares postfix/local[8296]: name_mask: ipv4
May 1 14:34:23 antares postfix/local[8296]: inet_addr_local: configured 2 IPv4 addresses
May 1 14:34:23 antares postfix/local[8296]: process generation: 20 (20)
May 1 14:34:23 antares postfix/local[8296]: Compiled against Berkeley DB: 4.8.30?
May 1 14:34:23 antares postfix/local[8296]: Run-time linked against Berkeley DB: 4.8.30?
May 1 14:34:23 antares postfix/local[8296]: dict_open: hash:/etc/aliases
May 1 14:34:23 antares postfix/local[8296]: match_string: fast_flush_domains ~? debug_peer_list
May 1 14:34:23 antares postfix/local[8296]: match_string: fast_flush_domains ~? fast_flush_domains
May 1 14:34:23 antares postfix/local[8296]: set_eugid: euid 112 egid 124
May 1 14:34:23 antares postfix/local[8296]: name_mask: alias
May 1 14:34:23 antares postfix/local[8296]: name_mask: forward
May 1 14:34:23 antares postfix/local[8296]: name_mask: alias
May 1 14:34:23 antares postfix/local[8296]: name_mask: forward
May 1 14:34:23 antares postfix/local[8296]: name_mask: canonical
May 1 14:34:23 antares postfix/local[8296]: name_mask: virtual
May 1 14:34:23 antares postfix/local[8296]: name_mask: command
May 1 14:34:23 antares postfix/local[8296]: name_mask: file
May 1 14:34:23 antares postfix/local[8296]: name_mask: forward
May 1 14:34:23 antares postfix/local[8296]: name_mask: fcntl
May 1 14:34:23 antares postfix/local[8296]: name_mask: dotlock
May 1 14:34:23 antares postfix/local[8296]: fatal: unable to determine open file limit
May 1 14:34:24 antares postfix/master[8124]: warning: process /usr/lib/postfix/local pid 8296 exit status 1
May 1 14:34:24 antares postfix/master[8124]: warning: /usr/lib/postfix/local: bad command startup -- throttling

Observed effects: see above
Expected results: 'local' delivery should work.
---
Architecture: powerpc
DistroRelease: Ubuntu 11.04
Package: postfix 2.8.2-1ubuntu2
PackageArchitecture: powerpc
ProcEnviron:
 LANGUAGE=de_DE:en
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
Tags: natty
Uname: Linux 2.6.36.2 ppc
UpgradeStatus: Upgraded to natty on 2011-04-30 (6 days ago)
UserGroups:

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Albrecht, I'm getting no such failure on my amd64 11.04 machines, I wonder if this is a problem for powerpc only.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Albrecht, it would help us determine the status of this bug if you could run

sudo apport-collect 774852

in a terminal

Thanks!

Revision history for this message
Albrecht Dreß (albrecht-dress) wrote : Dependencies.txt

apport information

tags: added: apport-collected natty
description: updated
Revision history for this message
Albrecht Dreß (albrecht-dress) wrote :

Hi Clint:

Asking Google about this issue, I found some complaints from Gentoo users related to glibc 2.13 and pre-linking [1]. However, the prelink package is not installed on my box, and installing it doesn't change anything. It might have been a build issue, though.

An other source might be the fact that the PowerPC is a big-endian, but I doubt that this is the source, as I *never* had any problem with Postfix in the past, neither with Ubuntu, nor with Yellowdog or Fedora I used in the past.

Thanks, Albrecht

[1] <http://www.google.com/search?client=ubuntu&channel=fs&q=postfix+local+fatal%3A+%22unable+to+determine+open+file+limit%22&ie=utf-8&oe=utf-8>

Revision history for this message
Albrecht Dreß (albrecht-dress) wrote :

I re-compiled the package with some extra information (added strerror(errno) at varoius places). The reason for the failing 'local' process is in src/util/open_limit.c, where the call to getrlimit (yes, *not* setrlimit!) fails with EPERM. That's really strange!

BTW, I don't have SElinux enabled...

Revision history for this message
Patrick van Oostrom (patrick-meukinc) wrote :

I am having the same issues on my boxes, running i386

This is what I found in the mail.log

May 12 08:45:50 vps594 postfix/postdrop[6857]: fatal: getrlimit: Operation not permitted
May 12 08:45:51 vps594 postfix/sendmail[6856]: warning: command "/usr/sbin/postdrop -r" exited with status 1
May 12 08:45:51 vps594 postfix/sendmail[6856]: fatal: patrick(1000): unable to execute /usr/sbin/postdrop -r: Success
May 12 08:46:04 vps594 postfix/local[6861]: fatal: unable to determine open file limit
May 12 08:46:05 vps594 postfix/master[3986]: warning: process /usr/lib/postfix/local pid 6861 exit status 1
May 12 08:46:05 vps594 postfix/master[3986]: warning: /usr/lib/postfix/local: bad command startup -- throttling

Revision history for this message
Albrecht Dreß (albrecht-dress) wrote :

Side note: the following code runs fine on my box:

<code>
#include <sys/resource.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    struct rlimit rl;
    int result;

    result = getrlimit(RLIMIT_NOFILE, &rl);
    printf("%d -> %d %d\n", result, (int) rl.rlim_cur, (int) rl.rlim_max);
    return 0;
}
</code>

Running it as user, the result is

albrecht@antares:~/ubuntu$ ./test_lim
0 -> 1024 4096

Strange!!

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Fascinating. The getrlimit kernel code should never return -EPERM, nor lead to any selinux or apparmor calls fwiw. I'd be curious to see an strace of local. If in fact a call to the kernel/sys.c:getrlimit() is returning -EPERM, then the arguments passed to do_prlimit are being corrupted along the way.

More likely would seem to be a problem with glibc. We could try an instrumented kernel to find out more.

Is this 32- or 64-bit?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Marking this 'high' importance as I think it falls into 'Has a severe impact on a small portion of Ubuntu users'

Changed in postfix (Ubuntu):
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Tried to reproduce this on i386, but couldn't.

Albrecht, it's a long shot, but could you try this modified getrlimit test program? (replace 112 and 105 with the gid and uid for postfix, respectively, if they are different on your system).

#include <sys/resource.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    struct rlimit rl;
    int result;

    result = setresgid(0,112,0);
    printf("setresgid result is %d\n", result);
    result = setresuid(0,105,0);
    printf("setresuid result is %d\n", result);
    result = getrlimit(RLIMIT_NOFILE, &rl);
    printf("%d -> %d %d\n", result, (int) rl.rlim_cur, (int) rl.rlim_max);
    return 0;
}

Revision history for this message
Albrecht Dreß (albrecht-dress) wrote :

Hi Serge:

Thanks a lot for your comment - the getrlimit() behaviour is indeed puzzling!

Having a closer look at my system, I believe I found the reason, though. The Ubuntu upgrade from 10.10 to 11.04 failed to change the bootloader config (yaboot on Mac's) to boot the kernel coming with the new release. As a result, I was still running 2.6.36.2 (self-compiled, as I had to remove some graphics stuff - the Mac shipped with a special Apple OEM ATI card, which didn't work with the stock kernel; different story). Sorry, but I really forgot to look at the proper kernel version!

I manually changed yaboot.conf, rebooted - and now postfix runs again, *without* the getrlimit issue! This looks like a glibc vs. kernel incompatibility. Maybe this is also the reason while Patrick van Oostrom (#6) has similar effects on i386? Interesting that *no* other application showed similar effects.

From my pov, you could close this one (Tag "user too stupid" :-/ )...

Thanks again for your help,
Albrecht.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Marking invalid based on reporter feedback.

Changed in postfix (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.