[MacRuby-devel] [MacRuby] #633: Segmentation fault using Net::SMTP on background thread

MacRuby ruby-noreply at macosforge.org
Fri Mar 19 10:11:21 PDT 2010


#633: Segmentation fault using Net::SMTP on background thread
-----------------------------------+----------------------------------------
 Reporter:  wbyoung@…              |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  major                  |   Milestone:                       
Component:  MacRuby                |    Keywords:                       
-----------------------------------+----------------------------------------
 The following code causes a segmentation fault.  The third line from the
 bottom is commented out, but executes the test method on the main thread
 and works fine.

 I'm using MacRuby version 0.5.

 {{{
 require 'net/smtp'

 framework 'Cocoa'

 class Test
         def execute
                 username = ''
                 password = ''
                 server = ''
                 to = ''
                 port = 0

                 connection = Net::SMTP.new(server, port)
                 connection.enable_starttls_auto()
                 connection.start(server, username, password, :login) {
 |smtp|
                         smtp.send_message "Subject: Example\r\n\r\nHello
 world!\r\n", nil, [to]
                 }
         end
 end


 # Test.new.execute
 NSThread.detachNewThreadSelector("execute", toTarget:Test.new,
 withObject:nil)
 NSThread.sleepForTimeInterval(60)

 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/633>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list