Steffen Kaiser
2007-Jun-12 08:10 UTC
[Dovecot] SEGV when user over filesystem quota and "Move to Trash"
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've configured Dovecot v1.0.0 with filesystem quota and to use hardlinks. Latter I use intentionally to save disk space and to achieve that an user can delete mails even if over quota and using the "Delete to Trash" feature. The following happens, when the directory file of .Trash/* fills up and would need to be expanded, but fails because of an over-quota condition. The crash is not so problematic, because you can wait some time (I guess until the lock of .Trash/dovecot-uidlist.lock expires) and you can delete mails from Trash to make room. However, there are leftover files in .Trash/tmp, what may make problems. First you get a "Out of quota" error in the MUA, maybe a second or a third time, too. Then: dovecot: Jun 12 09:10:38 Info: IMAP(dvtest) [3492]: copy -> Trash: uid=500, msgid=<cs-HoeqDW06gzBNu-9HdUBR4A@> dovecot: Jun 12 09:10:38 Error: child 3492 (imap) killed with signal 11 When you try to delete another mail: process #1: nanosleep({0, 158957000}, NULL) = 0 lstat64("/var/cache/dovecot/31045/control/.Trash/dovecot-uidlist.lock", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 time(NULL) = 1181630732 nanosleep({0, 170189000}, NULL) = 0 lstat64("/var/cache/dovecot/31045/control/.Trash/dovecot-uidlist.lock", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 time(NULL) = 1181630732 process #2: gettimeofday({1181630713, 945424}, NULL) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=2, events=POLLERR|POLLHUP|POLLNVAL}, {fd=0, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 3, 9335) = 0 gettimeofday({1181630723, 281935}, {4294967176, 0}) = 0 gettimeofday({1181630723, 282014}, NULL) = 0 poll([{fd=4, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}, {fd=2, events=POLLERR|POLLHUP|POLLNVAL}, {fd=0, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL}], 3, 9999) = 0 gettimeofday({1181630733, 281949}, {4294967176, 0}) = 0 gettimeofday({1181630733, 282149}, NULL) = 0 .Trash/tmp contains 28 items (growing) After the "Connection timeout" error in the client process #1 still loops repeatedly. Eventually the processes stops. Maybe it is waiting for the release of the lock by the process killed by segv? Finally it dumps core, too. dovecot: Jun 12 09:10:38 Info: IMAP(dvtest) [3821]: copy -> Trash: uid=500, msgid=<cs-HoeqDW06gzBNu-9HdUBR4A@> dovecot: Jun 12 09:12:39 Error: child 3821 (imap) killed with signal 11 Core was generated by `imap [dvtest 10.20.10.63]'. Program terminated with signal 11, Segmentation fault. #0 maildir_sync_get_keywords_sync_ctx (ctx=0xffffffff) at maildir-sync.c:242 242 { (gdb) bt #0 maildir_sync_get_keywords_sync_ctx (ctx=0xffffffff) at maildir-sync.c:242 #1 0x0806ddd4 in maildir_mf_get_path (ctx=0x0, mf=0x20) at maildir-save.c:263 #2 0x0806de80 in maildir_transaction_unlink_copied_files (ctx=0x80fcbb0, pos=0x0) at maildir-save.c:477 #3 0x0806e5cb in maildir_transaction_save_commit_pre (ctx=0x80fcab0) at maildir-save.c:561 #4 0x080693c4 in maildir_transaction_commit (_t=0x8101eb8, flags=0) at maildir-transaction.c:28 #5 0xb7ddbbd0 in quota_mailbox_transaction_commit (ctx=0x8101eb8, flags=0) at quota-storage.c:74 #6 0x08057965 in cmd_copy (cmd=0x80df0f0) at cmd-copy.c:124 #7 0x0805b1be in cmd_uid (cmd=0x80df0f0) at cmd-uid.c:19 #8 0x0805b728 in client_handle_input (cmd=0x80df0f0) at client.c:335 #9 0x0805b7b7 in client_handle_input (cmd=0x80df0f0) at client.c:389 #10 0x0805be3c in _client_input (context=0x80df0a8) at client.c:432 #11 0x080bc902 in io_loop_handler_run (ioloop=0x80dc9b0) at ioloop-poll.c:199 #12 0x080bbb58 in io_loop_run (ioloop=0x80dc9b0) at ioloop.c:326 #13 0x08063e80 in main (argc=Cannot access memory at address 0x0 ) at main.c:290 I also managed it to have to two processes waiting for /var/cache/dovecot/31045/control/.Trash/dovecot-uidlist.lock. dovecot -n: # /usr/local/dovecot/etc/dovecot.conf base_dir: /var/run/dovecot/ log_path: /var/log/dovecot/dovecot.log protocols: imap imaps pop3 pop3s ssl_ca_file: /etc/ssl/certs/ca.crt ssl_cert_file(default): /etc/ssl/certs/imap.pem ssl_cert_file(imap): /etc/ssl/certs/imap.pem ssl_cert_file(pop3): /etc/ssl/certs/pop3.pem ssl_key_file(default): /etc/ssl/private/imap.key ssl_key_file(imap): /etc/ssl/private/imap.key ssl_key_file(pop3): /etc/ssl/private/pop3.key disable_plaintext_auth: no verbose_ssl: yes login_dir: /var/run/dovecot//login login_executable(default): /usr/local/dovecot/libexec/dovecot/imap-login login_executable(imap): /usr/local/dovecot/libexec/dovecot/imap-login login_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3-login login_log_format_elements: %p: user=<%u> method=%m rip=%r lip=%l %c verbose_proctitle: yes first_valid_uid: 1000 mail_location: maildir:%h/MailDir:CONTROL=/var/cache/dovecot/%i/control:INDEX=/var/cache/dovecot/%i/index mail_debug: yes dotlock_use_excl: yes maildir_copy_with_hardlinks: yes maildir_copy_preserve_filename: yes mail_drop_priv_before_exec: yes mail_executable(default): /usr/local/dovecot/libexec/dovecot/rawlog /usr/local/dovecot/libexec/dovecot/imap mail_executable(imap): /usr/local/dovecot/libexec/dovecot/rawlog /usr/local/dovecot/libexec/dovecot/imap mail_executable(pop3): /usr/local/dovecot/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_log zlib mail_plugins(imap): quota imap_quota mail_log zlib mail_plugins(pop3): quota mail_log mail_plugin_dir(default): /usr/local/dovecot/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/dovecot/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/dovecot/lib/dovecot/pop3 mail_log_prefix: %Us(%u) [%p]: mail_log_max_lines_per_sec: 0 pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %u pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): oe-ns-eoh namespace: type: private separator: . inbox: yes hidden: yes auth default: mechanisms: plain login cache_size: 10 username_chars: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 verbose: yes debug: yes passdb: driver: ldap args: /usr/local/dovecot/etc/dovecot-ldap.conf userdb: driver: ldap args: /usr/local/dovecot/etc/dovecot-ldap.conf userdb: driver: passwd-file args: /etc/passwd socket: type: listen client: master: path: /var/run/dovecot/auth-master mode: 432 group: mail plugin: quota: fs Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRm5VCi9SORjhbDpvAQLDQwgAp0Zcg4SbTXXyFTUFVsxRHjhRr1V2ZuoE Ajpar7u5hoG8IfJ8u6noxk2XvNlD0rL0g/oXHJDeRTuZs6PVwcQpSEyQ0DNUx8BY bUyX5i3sR02MOrwbKvlq6ynvV3VE5PY4fpgCfqUv7ZE4W72u577IQ4l/C3+hgC+Y qzKw2URlVzoJj6apyXEIZcv4gvxkxl4mMtOmoXrTj5nMfz7EFbbuXuK9aYfFhLFp YB/Q0FxsU3YylpYYbFGronbmrAUGb2TCJckRAwDdTzT1s++6uvbJt5BLRnwiOK6H UAEuJJllwoDcwx0WIwMzf3SXP52OSqHdEVBuJprxpHrTI7Fe2fm5FA==WkkL -----END PGP SIGNATURE-----
Steffen Kaiser
2007-Jun-12 08:35 UTC
[Dovecot] SEGV when user over filesystem quota and "Move to Trash"
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 12 Jun 2007, Steffen Kaiser wrote: The same occurs with v1.0.1rc2 #0 maildir_sync_get_keywords_sync_ctx (ctx=0xffffffff) at maildir-sync.c:243 243 { (gdb) bt #0 maildir_sync_get_keywords_sync_ctx (ctx=0xffffffff) at maildir-sync.c:243 #1 0x0806df74 in maildir_mf_get_path (ctx=0x0, mf=0x20) at maildir-save.c:263 #2 0x0806e020 in maildir_transaction_unlink_copied_files (ctx=0x81a0b78, pos=0x0) at maildir-save.c:477 #3 0x0806e76b in maildir_transaction_save_commit_pre (ctx=0x81a0a78) at maildir-save.c:561 #4 0x080694d4 in maildir_transaction_commit (_t=0x81489e0, flags=0) at maildir-transaction.c:28 #5 0xb7e66bd0 in quota_mailbox_transaction_commit (ctx=0x81489e0, flags=0) at quota-storage.c:74 #6 0x08057925 in cmd_copy (cmd=0x80df178) at cmd-copy.c:125 #7 0x0805b17e in cmd_uid (cmd=0x80df178) at cmd-uid.c:19 #8 0x0805b6e8 in client_handle_input (cmd=0x80df178) at client.c:335 #9 0x0805b777 in client_handle_input (cmd=0x80df178) at client.c:389 #10 0x0805bdfc in _client_input (context=0x80df130) at client.c:432 #11 0x080bcc42 in io_loop_handler_run (ioloop=0x80dc9b0) at ioloop-poll.c:199 #12 0x080bbe98 in io_loop_run (ioloop=0x80dc9b0) at ioloop.c:329 #13 0x08063e40 in main (argc=Cannot access memory at address 0x0 ) at main.c:290 Bye, - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQEVAwUBRm5a1C9SORjhbDpvAQKYPgf8DPoF1ZncgOcNXMb6F1ctCjhJYGXUDTrK NZuz7eshAWgdgG3O88UCZofg7TTgpQ48/QFy/25jQb/fwS1b5JNHnuq9Ev2wrsHB 5amVv8P15FjBsgiUDmBnJ4axbxyi6oUb6kF6vlHhHB/owai/vL/rOUYtNVRrQniL 2pjsQRcDshSpj8dD3dwnmhunaEEheIEmftQCusdjuj8ACgJof1DezEne4/57jn/N P9HN+wiH5mLaF4ij/F4FC9yVezWfh98V6c4BKwwjsEIxgeT9r8DHfaAT5RZT4ebf R4jqKoCUm/45S4WCSGhVpNFJLyh5oBUXZReFSjCdBEhTvEVned44aw==2orr -----END PGP SIGNATURE-----