courier-imap: imapd segfaults when scanning mail

Bug #6904 reported by Debian Bug Importer
This bug report is a duplicate of:  Bug #6903: courier-imap: CLOSE failed. Edit Remove
4
Affects Status Importance Assigned to Milestone
courier (Debian)
Fix Released
Unknown
courier (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Automatically imported from Debian bug report #254731 http://bugs.debian.org/254731

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <20040616165258.95F013F3C@galadriel>
Date: Wed, 16 Jun 2004 18:52:58 +0200
From: Anton Emmerfors <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: courier-imap: imapd segfaults when scanning mail

Package: courier-imap
Version: 3.0.3-3
Severity: important
Tags: sid

Since uppgrading the courier-imap package (which worked flawlessly
before this) it segfaults while scanning the Maildir. I have not been
able to identify any particular message or maildir that is responsible
for the segfault as it happens at different times on different tries.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.16
Locale: LANG=C, LC_CTYPE=sv_SE.ISO-8859-1

Versions of packages courier-imap depends on:
ii courier-authdaemon 0.45.4-3 Courier Mail Server - Authenticati
ii courier-base 0.45.4-3 Courier Mail Server - Base system
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an
ii libfam0c102 2.7.0-5 client library to control the FAM
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime
ii postfix [mail-transport-age 2.1.1-8 A high-performance mail transport

-- debconf information:
* courier-imap/moveconfig: true

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Wed, 16 Jun 2004 19:17:40 +0200
From: Stefan Hornburg <email address hidden>
To: Anton Emmerfors <email address hidden>, <email address hidden>
Subject: Re: Bug#254731: courier-imap: imapd segfaults when scanning mail

On Wed, 16 Jun 2004 18:52:58 +0200
Anton Emmerfors <email address hidden> wrote:

> Package: courier-imap
> Version: 3.0.3-3
> Severity: important
> Tags: sid
>=20
> Since uppgrading the courier-imap package (which worked flawlessly
> before this) it segfaults while scanning the Maildir. I have not been
> able to identify any particular message or maildir that is responsible
> for the segfault as it happens at different times on different tries.

Hello, Anton !

I need some more information in order to help me tracing this bug down:

* which mail clients do you use ?
* is FAM installed and running ?
* which is the file system where the maildirs are located ?

Thanks
 Racke

--=20
Upcoming Talks and Presentations:
Linuxtag 2004, 25. Juni: Courier Mail Server (http://www.linuxtag.org/)
Perlworkshop 2004, 30. Juni: Entwicklung gro=DFer Perlanwendungen=20
am Beispiel von Interchange (http://www.perlworkshop.de/)

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Wed, 30 Jun 2004 14:59:33 +0200
From: Stefan Hornburg <email address hidden>
To: <email address hidden>
Subject: Severe problems with Courier-IMAP

severity 254731 serious
severity 257006 serious
tags 257006 + sid
severity 256460 serious
tags 256460 + sid
severity 255069 serious
tags 253304 + sid
severity 253304 serious
merge 256460 257006 254731 255069 253304
thanks

--=20
Upcoming Talks and Presentations:
Perlworkshop 2004, 30. Juni: Entwicklung gro=DFer Perlanwendungen=20
am Beispiel von Interchange (http://www.perlworkshop.de/)

Revision history for this message
Matt Zimmerman (mdz) wrote :

This bug has been marked as a duplicate of bug 6903.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sat, 10 Jul 2004 14:59:56 +0200
From: Stefan Hornburg <email address hidden>
To: <email address hidden>

severity 258445 serious
merge 253304 258445
thanks

--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (6.5 KiB)

Message-Id: <email address hidden>
Date: Sun, 11 Jul 2004 12:35:48 +0200
From: Stefan Hornburg <email address hidden>
To: <email address hidden>, <email address hidden>, <email address hidden>,
 <email address hidden>, <email address hidden>, <email address hidden>
Cc: <email address hidden>, <email address hidden>
Subject: Courier Debian Packaging Problem (IMAP + FAM)

--Multipart=_Sun__11_Jul_2004_12_35_48_+0200_o6OBYd=gyCWXBfy5
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hello,

I need your help and advice for the courier packaging problem described
below. Please read on.

Situation:
Courier can be compiled with or without FAM support. If FAM support is
included but FAM isn't running, this message is repeatedly written to
syslog:

Jul 10 23:31:44 turtle imaplogin: Failed to create cache file: maildirwatch (<email address hidden>)
Jul 10 23:31:44 turtle imaplogin: Error: Input/output error
Jul 10 23:31:44 turtle imaplogin: Check for proper operation and configuration
Jul 10 23:31:44 turtle imaplogin: of the File Access Monitor daemon (famd).

This is fine for source builds, but leads to problems for packagers.
Either we need to depend on the FAM daemon package or logs get filled
with the messages above. Both scenarios doesn't have a great appeal to me
(see also Debian bugs #191007, #204405, #206626, #238990, #242837
for reference).

Steve Langasek was so kind to write a patch to cope with this situation,
but unfortunately this patch leads to memory corruption like that:

Program received signal SIGSEGV, Segmentation fault.
0x400d2219 in malloc () from /lib/libc.so.6
(gdb) backtrace
#0 0x400d2219 in malloc () from /lib/libc.so.6
#1 0x400d2074 in malloc () from /lib/libc.so.6
#2 0x0806cd0a in maildir_info_imap_find (info=0xbfffb2ac, path=0x81872e0 "INBOX.Trash",
    myId=0xbffffebe "<email address hidden>") at maildirinfo.c:179
#3 0x0804d02b in decode_valid_mailbox (p=0x81872e0 "INBOX.Trash", autosubscribe=1) at imapd.c:327
#4 0x0804d651 in parse_mailbox_error (tag=0xbfffb5b8 "19", curtoken=0x8182780, ok_hierarchy=0,
    autosubscribe=1) at imapd.c:572
#5 0x080538d2 in do_imap_command (tag=0xbfffb5b8 "19") at imapd.c:4773
#6 0x0805eae3 in mainloop () at mainloop.c:93
#7 0x08056516 in main (argc=2, argv=0xbffff6a4) at imapd.c:6354

See Debian bugs #253304, #254731, #255069, #256460, #257006, #258445 for reference.

Solution:

1. Resolve the memory corruption in the patch (see attachment). If you want to
   compile for debugging with the debian/rules file,
   change CFLAGS=-lcrypt to LDFLAGS=-lcrypt and uncomment dh_strip

2. New scenario to solve the problem:

   * test whether FAM is available in the courier-imap init script
  and set an environment variable accordingly (like FAMIGNORE)

   * change the source code to test this environment variable and
  skip FAM access if environment variable if set

Any advice or further help would be appreciated immensely.

With regards
 Racke

--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

--Multipart=_Sun__11_...

Read more...

Revision history for this message
Debian Bug Importer (debzilla) wrote :
Download full text (7.3 KiB)

Message-Id: <email address hidden>
Date: Mon, 12 Jul 2004 10:32:07 -0400
From: Stefan Hornburg (Racke) <email address hidden>
To: <email address hidden>
Subject: Bug#253304: fixed in courier 0.45.6-1

Source: courier
Source-Version: 0.45.6-1

We believe that the bug you reported is fixed in the latest version of
courier, which is due to be installed in the Debian FTP archive:

courier-authdaemon_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-authdaemon_0.45.6-1_i386.deb
courier-authmysql_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-authmysql_0.45.6-1_i386.deb
courier-authpostgresql_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-authpostgresql_0.45.6-1_i386.deb
courier-base_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-base_0.45.6-1_i386.deb
courier-doc_0.45.6-1_all.deb
  to pool/main/c/courier/courier-doc_0.45.6-1_all.deb
courier-faxmail_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-faxmail_0.45.6-1_i386.deb
courier-imap-ssl_3.0.5-1_i386.deb
  to pool/main/c/courier/courier-imap-ssl_3.0.5-1_i386.deb
courier-imap_3.0.5-1_i386.deb
  to pool/main/c/courier/courier-imap_3.0.5-1_i386.deb
courier-ldap_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-ldap_0.45.6-1_i386.deb
courier-maildrop_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-maildrop_0.45.6-1_i386.deb
courier-mlm_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-mlm_0.45.6-1_i386.deb
courier-mta-ssl_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-mta-ssl_0.45.6-1_i386.deb
courier-mta_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-mta_0.45.6-1_i386.deb
courier-pcp_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-pcp_0.45.6-1_i386.deb
courier-pop-ssl_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-pop-ssl_0.45.6-1_i386.deb
courier-pop_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-pop_0.45.6-1_i386.deb
courier-ssl_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-ssl_0.45.6-1_i386.deb
courier-webadmin_0.45.6-1_i386.deb
  to pool/main/c/courier/courier-webadmin_0.45.6-1_i386.deb
courier_0.45.6-1.diff.gz
  to pool/main/c/courier/courier_0.45.6-1.diff.gz
courier_0.45.6-1.dsc
  to pool/main/c/courier/courier_0.45.6-1.dsc
courier_0.45.6.orig.tar.gz
  to pool/main/c/courier/courier_0.45.6.orig.tar.gz
sqwebmail_0.45.6-1_i386.deb
  to pool/main/c/courier/sqwebmail_0.45.6-1_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stefan Hornburg (Racke) <email address hidden> (supplier of updated courier package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 12 Jul 2004 00:14:44 +0200
Source: courier
Binary: courier-authpostgresql courier-ldap courier-faxmail courier-pcp courier-authmysql courier-imap courier-authdaemon courier-base sqwebmail courier-ssl cour...

Read more...

Changed in courier:
status: Unknown → Fix Released
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.