The postfix/local daemon segfaults and produces an "unknown mail transport error" - thus mails to local system accounts are no longer deliverable. They just stick in the queue. However, virtual mail users with maildirs hosted locally via mysql on the same system are still receiving mails. The system was upgraded from postfix 2.5.5 which ran stable with the same setup, to postfix 2.6.6 (currently stable in portage). I tried to go to keyworded 2.6.7 but still have the same problem. Reproducible: Always Actual Results: postfix/local segfaults, seemingly because user name expansion results in a null pointer Expected Results: postfix/local should work like before and deliver mails to the local maildir in the system user's homedir. I'll attach backtrace and configuration. The problem was already posted to the postfix-users mailing list. But it looks like 2.6.7 is already rather "old" (current stable is 2.7.x, 2.6 series is already "past stable"). I consider this critical as mails are deferred and then bounced when the retry timeout has expired. The mail is lost then.
Created attachment 238871 [details] postfix/local backtrace (v2.6.6)
Created attachment 238873 [details] output of postconf -n (v2.6.6)
Created attachment 238875 [details] output of emerge --info
Created attachment 238877 [details] postfix/local backtrace (v2.6.6) Here's a more complete backtrace (generated with "bt full")
Adding "-O2" to CFLAGS (an "-Ox" parameter was missing) solved the problem. Seems to be an GCC issue. I leave this bug open to let the experts handle how to solve this report. I don't know if setting "-O2" is mandatory, or if postfix should compile and work fine without this or with another optimizer level. Maybe the ebuild should just force "-O2" or other compatible optimizer levels. If someone wants to debug this further: The pointer to the problem is within src/local/recipient.c:319 when the "state" struct is passed to deliver_switch(): Just before the call the struct members are set correct, then on entering the function, the members are reset to the original values on the stack when deliver_recipient() (the calling function) was entered (and thus state.msg_attr.local is reset to 0x0).
Possibly related: http://bugs.gentoo.org/76512
Is this still an issue with the 2.7.* or 2.8.* versions currently in the tree?
I cannot try, since the affected system is a production system. However, using "-O2" fixes the problem - probably using GCC4 may fix it, too. Originally, the system used GCC3. It has been converted to using GCC4 meanwhile since newer hardened-sources require it (compiling the kernel would result in a compilation error otherwise, and the kernel no longer officially supports GCC3).
(In reply to comment #8) > I cannot try, since the affected system is a production system. > > However, using "-O2" fixes the problem - probably using GCC4 may fix it, too. > Originally, the system used GCC3. It has been converted to using GCC4 meanwhile > since newer hardened-sources require it (compiling the kernel would result in a > compilation error otherwise, and the kernel no longer officially supports > GCC3). Ok, I think I'll mark this fixed since I can't reproduce it. Feel free to reopen it if you can reproduce the issue with GCC4 and any version of postfix in the tree. Thanks.