VM

Virtual folders of IMAP folders can't get new mail

Bug #614413 reported by Uday Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Released
High
Uday Reddy

Bug Description

This problem occurred twice, using Emacs 22. Doing a get new mail in an IMAP folder ended up getting multiple copies, apparently in an infinite loop. The *Messages* buffer shows the following sequence being repeated:

Checking for new mail for d:/Home/udr/mail/cache/imap-cache-edb15217b986b74f2751726a69a193f6...
Logging into the IMAP server...
Updating attributes on the IMAP server... done
Retrieving message attributes and labels...
Retrieving message atrributes and labels... done
Retrieving new messages...
Updating summary...
Sorting... done
3859 messages, 17 new, 207 unread, 6 deleted
Decoding MIME message...
Inlining text/html by emacs-w3m...
Decoding base64... done
Inlining text/html by emacs-w3m... done.
Decoding MIME message... done
3859 messages, 17 new, 207 unread, 6 deleted
Checking for new mail for d:/Home/udr/mail/cache/imap-cache-edb15217b986b74f2751726a69a193f6...

Eventually, Decoding base64 line is followed by

Inline text/html by emacs-w3m display failed: (error "Variable binding depth exceeds max-specpdl-size")
Decoding MIME message... done
3882 messages, 40 new, 207 unread, 6 deleted
Checking for new mail for d:/Home/udr/mail/cache/imap-cache-edb15217b986b74f2751726a69a193f6...
Logging into the IMAP server...
Updating attributes on the IMAP server... done
Retrieving message attributes and labels...
Retrieving message atrributes and labels... done
Retrieving new messages...
Updating summary...
Sorting... done
font-lock-extend-jit-lock-region-after-change: Variable binding depth exceeds max-specpdl-size

9 copies of the retrieved messages appear in the INBOX. All of them have 0 as the size.

9 IMAP sessions have been created and destroyed, and a final one created in the end but not terminated.

The messages in the INBOX have

body-to-be-discarded = t
body-to-be-retrieved = nil
uid = nil
uidvalidity = nil
spam-score = nil

Tags: 8.2 imap virtual

Related branches

Revision history for this message
Uday Reddy (reddyuday) wrote :

debug-on-entry shows the following. Why is vm-imap-synchronize-folder being entered recursively?

* vm-imap-synchronize-folder(t nil t t t t)
  vm-get-spooled-mail(t)
  byte-code(... 10)
  vm("d:/Home/udr/mail/cache/imap-cache-edb15217b986b74f2751726a69a193f6" nil nil)
  vm-visit-folder("d:/Home/udr/mail/cache/imap-cache-edb15217b986b74f2751726a69a193f6")
  vm-build-virtual-message-list(...)
  vm-assimilate-new-messages(t)
  byte-code(... 9)
* vm-imap-synchronize-folder(t nil t t t t)
  vm-get-spooled-mail(t)
  vm-get-new-mail(nil)
  call-interactively(vm-get-new-mail)

tags: added: virtual
removed: threads
Revision history for this message
Uday Reddy (reddyuday) wrote :

The problem seems to be that there is a virtual folder based on the IMAP folder. Its definition says that it is actually based on the corresponding cache-folder on the disk. So, vm-build-virtual-message-list is trying to visit that folder. Craziness!

Uday Reddy (reddyuday)
summary: - Variable binding depth error during IMAP get new mail
+ Variable depth binding error during IMAP get new mail
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.1.93a → 8.1.94a
Uday Reddy (reddyuday)
summary: - Variable depth binding error during IMAP get new mail
+ Virtual folders of IMAP folders can't get new mail
Revision history for this message
Uday Reddy (reddyuday) wrote :

Couldn't reproduce this problem today. Even though the virtual folder definition is based on the cache-folder, since the folder is already loaded into a buffer, visiting the folder merely switches to the buffer. Why was this supposed to be a problem?

Revision history for this message
Uday Reddy (reddyuday) wrote :

It is a problem because visiting the folder gives enters it in an inconsistent state.

The revision 966 avoids this in some cases. Not clear if this works in general.

Changed in vm:
status: Triaged → In Progress
Uday Reddy (reddyuday)
Changed in vm:
status: In Progress → Fix Committed
Uday Reddy (reddyuday)
tags: added: 8.2
Revision history for this message
Uday Reddy (reddyuday) wrote :

Another instance of the problem found today:

Build a virtual folder based on an IMAP folder, and do get-new-mail in the IMAP folder. This ends up calling vm-build-virtual-message-list for the virtual folder, which calls vm-visit-folder on the IMAP folder. This tries to present a message, which involves vm-retrieve-real-message-body. Since the folder is still in an inconsistent state, this fails. (In particular, the uid field of the message vector is not defined yet.)

Changed in vm:
status: Fix Committed → In Progress
Revision history for this message
Uday Reddy (reddyuday) wrote :

This is now fixed in revision 1194.

vm-visit-folder now has an extra argument `revisit', which allows the folder to be revisited in a lightweight fashion without doing further processing in its inconsistent state.

Changed in vm:
status: In Progress → Fix Committed
Uday Reddy (reddyuday)
Changed in vm:
status: Fix Committed → Fix Released
Uday Reddy (reddyuday)
no longer affects: vm/8.1.x
Revision history for this message
Uday Reddy (reddyuday) wrote :

Continued in Bug 614413.

Revision history for this message
Uday Reddy (reddyuday) wrote :

That should have said, continued in Bug 924016.

Revision history for this message
Uday Reddy (reddyuday) wrote :

Revision 1310 has a stray edit that continues the fix for this problem.

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.