Project

General

Profile

Actions

Bug #2683

closed

IMAP hangs when receiving an unexpected "BYE" during login

Added by bpot (Bob Potter) almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-18 trunk 24186) [x86_64-linux]
Backport:
[ruby-core:27944]

Description

=begin
The main imap thread will hang if the receiving thread receives an unexpected "BYE" message during login. IMAP#receive_responses (lines 1054-7) sets the exception correctly but fails to break out of the main reading loop because 'break' is called inside of a block. During the next pass through the loop, an exception will be raised causing the receiving thread to die and the main thread to hang indefinitely. I've attached a patch and a test case. The test case should hang with the latest net/imap.rb but pass with the attached patch.

The patch is not very pretty, but I'm hesitant to make any large changes to that method. I'm more than happy to rework the patch if there is a better way to fix it.
=end


Files

imap_hang_fix.patch (875 Bytes) imap_hang_fix.patch bpot (Bob Potter), 01/29/2010 10:57 AM
imap_hang_test.patch (958 Bytes) imap_hang_test.patch bpot (Bob Potter), 01/29/2010 10:57 AM
Actions #2

Updated by shugo (Shugo Maeda) almost 15 years ago

  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)

=begin

=end

Actions #3

Updated by shugo (Shugo Maeda) almost 15 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26599.
Bob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0